javascript code !!!

Results 1 to 3 of 3

Thread: javascript code !!!

  1. #1
    Join Date
    Dec 1969

    Default javascript code !!!

    How to write a javascript that when you select item &#039;Other&#039; from a listbox, a text box labelled other will be enabled but when you selected item other than item &#039;Other&#039;, the textbox will be disabled? Thanks.<BR><BR>cc

  2. #2
    Join Date
    Dec 1969

    Default RE: javascript code !!!

    call a function for the onChange event of the select element and pass the selectedIndex. In the function, check to see if the value or text of the select element at the specified index is the one that corresponds to "Other". If it is, enable the text box, if not, disable it.

  3. #3
    Join Date
    Dec 1969

    Default One hour and 20 minutes to go...

    before I can flame your laziness.<BR><BR>var disableMe = false;<BR><BR>function thisFunction(){<BR><BR>if (disableMe)<BR> document.formname.textboxname.blur();<BR>}<BR><BR> function thatFunction(selectname){<BR> if (selectname == &#039;Other&#039;)<BR> disableMe = true;<BR> else<BR> disableMe = false;<BR>}<BR><BR>&#060;SELECT... onchange="thatFunction();"&#062;<BR>&#060;INPUT TEXT... onFocus="thisFunction();"&#062;<BR>

Posting Permissions

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