insert text into form using javascript PHP put content in textarea field link
Post Description: insert text into form using javascript PHP put content in textarea field link
Tags: insert, text, into, form, using, javascript, PHP, put, content, in, textarea, field, link
This Post Was Posted On Feb 29, 2008 By web hosting #1414
i created this simple code to show you how you can add text into a form using 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
appreciate it!
Powered by: Webune Forums V3