Results 1 to 3 of 3

Thread: echoing drop down list value to a text box

  1. #1
    Join Date
    Mar 2007
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default echoing drop down list value to a text box

    hi,
    i have a drop down list called c_email which has a list of email ids.i also have a text box called c_mail. what i want to do is when i choose an email id from the drop down list the empty text box should get populated with the same value.
    can someone help me with this?
    thanks in advance..Suk

  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

    Code:
    <form action="#">
    <div>
    <select name="c_email" onchange="this.form.elements['c_mail'].value = this.options[this.selectedIndex].value;">
    <option value="Select" selected>Select</option>
    <option value="someone_0@some.com">someone_0@some.com</option>
    <option value="someone_1@some.com">someone_1@some.com</option>
    <option value="someone_2@some.com">someone_2@some.com</option>
    <option value="someone_3@some.com">someone_3@some.com</option>
    <option value="someone_4@some.com">someone_4@some.com</option>
    <option value="someone_5@some.com">someone_5@some.com</option>
    </select>
    <input type="text" value="Select" name="c_mail">
    </div>
    </form>
    - John
    ________________________

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

  3. #3
    Join Date
    Mar 2007
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks

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
  •