in reply to How do I display a textbox only if a certain value is selected from a dropdown list

hi, Try out the following code
print "Content-type:text/html\n\n"; print << 'JavaScript'; <script language='javascript'> function alertselected(selectobj){ ss=selectobj.selectedIndex if(ss == 2){ document.getElementById('new').style.display='block'; } else{ document.getElementById('new').style.display='none'; } } </script> JavaScript print "<html><body><form name=frm1>"; print "<select name=os onChange='alertselected(this)'> <option value='redhat'>Redhat</option> <option value='centos'>Centos</option> <option value='others'>Others</option> </select>"; print "<input id=new type=text name=newos style='display: none;'></for +m></body></html>";
  • Comment on Re: How do I display a textbox only if a certain value is selected from a dropdown list
  • Download Code