SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to add text to form field

    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

  2. #2
    011521 dbalsdon's Avatar
    Join Date
    Feb 2003
    Location
    North Of Scotland
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Daniel Balsdon
    My Site

  3. #3
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    the quick way

    into head:
    PHP Code:
    <SCRIPT language=JavaScript>
    <!-- 
    Begin
    function B()
    {
    document.Add.write.value += ("<B> </B>\n")
    }
    // End-->
    </SCRIPT> 
    body..

    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



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •