Results 1 to 3 of 3

Thread: question about javascript

  1. #1
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default question about javascript

    i would like to create some buttons with javascript that once you click them they will add text to a textbox. i will try to do a example below.

    |----------|
    | button |
    |----------|

    ok click this button will add text to a text box, but it will not delete what i have currently typed.

    If anyone has any good tutorials i can read to make this work, or any ideas for me i would really appreciate it.

    Thanks in advance for the help.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If I understand you correctly, and you want to add text to the value of the text box, then in about the simplest of terms:

    Code:
    <form action="#">
    <input type="button" value="Do It" onclick="this.form.elements['bob'].value += ' Mary';">
    <input type="text" name="bob" value="Bob">
    </form>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    james_byrne (07-15-2008)

  4. #3
    Join Date
    Jul 2008
    Posts
    11
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Tanks very much, that is so easy. I love javascript.

    Once again thanks so much.

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
  •