Follow us on
You are here: Home > All Posts > N/A > Wipro > technical

Hide the text box on drop down menu change with Java Script
Posted by Ankit ( Verified Professional) from Wipro                                              
Posted On 280 Day 13 hour ago | Last Modified 280 Day 11 hour ago | Visit179
City: N/A

If you are looking for the Java script which helps to hide the text box on Drop down value change then please have a look at below code ...

DROP DOWN and TEXT BOX CODE :

<select name="abc" onChange="checkC(this, this.form);">
 <option value="">Please Select</option>
 <option value="a">A</option>
 <option value="b">B</option>
 <option value="c">C</option>
</select>

<input style="visibility:hidden" type="text" name="checkBox"/>

JAVA SCRIPT METHOD :

function checkC(obj, form)
{  
 if(obj.options[obj.selectedIndex].value == 'c'){
  form.checkBox.style.visibility='visible';
 }else
 {
  form.checkBox.style.visibility='hidden';
 }
}

I hope this will help someone.

Comments




Related Posts View All