Hey, 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.
How to pre-populate form field with javascript script!?
14
Hey,
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.
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
- marketkidz
- [1] reply
- warriorforumguest
- Jay27
- [ 1 ] Thanks
- LarryKeenan
- [ 1 ] Thanks
- charliemwallace
Next Topics on Trending Feed
-
14