mavis Posted December 12, 2012 Share Posted December 12, 2012 Hello can anyone help me with a code when someone choose other on a dropdown it pops a text box, in php and html Link to comment https://forums.phpfreaks.com/topic/271890-php/ Share on other sites More sharing options...
trq Posted December 12, 2012 Share Posted December 12, 2012 Sure, whats' your question? Link to comment https://forums.phpfreaks.com/topic/271890-php/#findComment-1398871 Share on other sites More sharing options...
Psycho Posted December 12, 2012 Share Posted December 12, 2012 Here is a quick and dirty example <html> <head> <script type="text/javascript"> function setOtherInput(colorSelect) { visibileState = (colorSelect.value==false) ? 'visible' : 'hidden'; document.getElementById('color_input').style.visibility = visibileState; } </script> </head> <body> Select a color: <select name="color" id="color" onchange="setOtherInput(this);"> <option value="red">Red</option> <option value="green">Green</option> <option value="blue">Blue</option> <option value="yello">Yellow</option> <option value="0">Other</option> </select><br> <div id="color_input" style="visibility:hidden">Other color: <input type="text" name="other_color" /></div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/271890-php/#findComment-1398909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.