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 Quote Link to comment Share on other sites More sharing options...
trq Posted December 12, 2012 Share Posted December 12, 2012 Sure, whats' your question? Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.