activating text boxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tolkienarda
    Contributor
    • Dec 2006
    • 316

    activating text boxes

    hi all
    i have an order form and some select boxes with 'other' options and i would like to have a text box for them to write what the 'other' is but i want it to only be visiable or active if someone selects the 'other' option from the drop down box.
    if someone could help me i would appreciate it

    eric
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    When I have an 'other' in a select element I park an input type=text next to it,
    and make its display "none' and it's size the length of the longest option text.
    .
    If the selected text is 'other' ,the select display is changed to "none" and the text input display to "inline".

    listen for the enter key on keypress or a blur from the textbox and

    validate and clear the input, add a new option and value (if valid) to the top of the select, swap the display, set the selectedIndex to 0 and run the select's onchange.

    A simpler method is to leave the input beside the select but visibility hidden
    unless other is selected, and run the onchange directly from the text box's onchange event.

    Comment

    • tolkienarda
      Contributor
      • Dec 2006
      • 316

      #3
      thanks a million

      eric

      Comment

      Working...