ok, lets say i have a form and on the form i want to insert some text using javascript.
i created this simple code to show you how you can add text into a form using javascript
<script language="JavaScript" type="text/JavaScript">
function AddItem(ItemId)
{
document.Form.bible_verse_description.value = document.Form.bible_verse_description.value + '<' + ItemId;
}
</script>
<form id="Form" name="Form" method="post" action="/jesuswillcome/bible/add-verse.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100"> </td>
<td width="15"> </td>
<td width="5">
<a href="#" onclick="AddItem('span style="color:#ff0000">');">open span</a>
<a href="#" onclick="AddItem('/span>');">close span</a> |||
<a href="#" onclick="AddItem('em>');">Open Italic</a>
<a href="#" onclick="AddItem('/em>');">close italic</a>
<BR></td>
</tr>
<tr>
<td>Verse</td>
<td> </td>
<td><textarea tabindex="1" name="bible_verse_description" cols="45" rows="5" id="bible_verse_description"></textarea></td>
</tr>
</table>
</form>
DEMO:
if you have a website and need web hosting, i always recommend a trusted web hosting place is always
Webune.com
I hope this helps
Comments and replies About insert text into form using javascript PHP put content in textarea field link
user:
thanks man, was looking for something like this, works like a charm.
appreciate it!
dave:
awesome script, just what i was looking for. thx!!
arturoz:
yeah! thanks man! i was looking for this ;]
i appreciate your work!
french:
insert into outfile avec textarea et mysql db
pondza:
it's work very well. thanks you.
Olland:
good good good...
good good good...
good good good...
good good good...
good good good...
good good good...
good good good...
Craig:
i think this might work for me but i need help!! :)
i have a photo gallery that automaticly creates the thumnail page and i've added a cheezy light box and now i'm trying to add a "order prints" button and i've got it to open another html or php page that i want to put the file name into a field the user can not edit.... but i can't get from link to the window to the field?
any help would be appreciated
thank you
Craig:
i think this might work for me but i need help!! :)
i have a photo gallery that automaticly creates the thumnail page and i've added a cheezy light box and now i'm trying to add a "order prints" button and i've got it to open another html or php page that i want to put the file name into a field the user can not edit.... but i can't get from link to the window to the field?
any help would be appreciated
thank you
Kitgg:
wow! love it, very simple, you good!