Hello,
How do you add text to a form field using javascript? For instance, you want to make something bold in a field and there is a B above the field. You click the B and it populates the field with <b></b> How do you do that?
Thanks
Silly
| SitePoint Sponsor |





Hello,
How do you add text to a form field using javascript? For instance, you want to make something bold in a field and there is a B above the field. You click the B and it populates the field with <b></b> How do you do that?
Thanks
Silly



Its recommended that you search through the other threads to find what you are looking for, as sometimes, the help you are needing is right under your nose..
as it is in this case...
when i posted this reply, the thread http://www.sitepointforums.com/showt...hreadid=120273 was directly beneath this thread on the forum....hopefully it should help, as your problem is exactly the same problem i had

the quick way
into head:
body..PHP Code:<SCRIPT language=JavaScript>
<!-- Begin
function B()
{
document.Add.write.value += ("<B> </B>\n")
}
// End-->
</SCRIPT>
PHP Code:<center>
<input onClick=B() type=button value="B" name="button1"></center>
<div align="center">
<form name="Add">
<textarea name="write"></textarea>
</form>
</div>
Who's to doom when the judge himself is dragged before the bar
![]()
![]()
Where I live | 2013@Vimeo | Northern lights
Bookmarks