How to pre-populate form field with javascript script!?
I am setting up a form for an online store, and need the title of the website to turn up into one of the fields, I don't want to type out each website title so I am wanting javascript to do it for me.
Here is the code I am using for the specific field...
<tr>
<td valign="top">
<label for="product">Product *</label>
</td>
<td valign="top">
<input type="text" name="product" maxlength="300" size="30">
</td>
</tr>
I need it to pre-populate with this script...
<script>
document.write(document.title);
</script>
...which grabs the website title.
However everyway I have tried of entering that just comes up with that as text instead of executing and showing up with the page title.
I am really stuck on this so any help would be awesome!
Cheers,
Charlie.
-
IdeaBox -
[ 1 ] Thanks - 1 reply
{{ DiscussionBoard.errors[8480477].message }}-
marketkidz -
Thanks - 1 reply
{{ DiscussionBoard.errors[8480757].message }}-
IdeaBox -
Thanks
{{ DiscussionBoard.errors[8481644].message }} -
-
-
-
warriorforumguest -
Thanks
SignatureXem tv online | xem vtv3 online | xem k+ online{{ DiscussionBoard.errors[8480983].message }} -
-
Jay27 -
[ 1 ] Thanks
SignatureBuild Your Widget - Claim Your Free Full Access Lifetime Membership Now!{{ DiscussionBoard.errors[8485106].message }} -
-
LarryKeenan -
[ 1 ] Thanks
{{ DiscussionBoard.errors[8491349].message }} -
-
charliemwallace -
Thanks
{{ DiscussionBoard.errors[8491414].message }} -