sunilpaladugu Posted April 20, 2011 Share Posted April 20, 2011 Hi alll I have the below issue I have one text box and one dropdown box(select box) in php my drop down list like <select name="some"> <option value"00">zero</option> <option value"11">non-zero</option> </select> if i am selecting the option "zero",the value of "zero" i.e, "00" need to be show in the textbox as a value can anybody help me to solve thanks in advance Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted April 21, 2011 Share Posted April 21, 2011 That's not PHP, that either Javascript or AJAX deppeding on exactly what source you are using for the textbox. Quick question though - why bother putting the contents of a select box into a text box on the same form? Quote Link to comment Share on other sites More sharing options...
sunfighter Posted April 21, 2011 Share Posted April 21, 2011 This is not php it's javascript, because you would need a submit button to do in without it. and it's not onchange it's onclick. If you want this done in php use forms with a submit button and call the php file. <html> <head> <script type="text/javascript"> function me(thing){ document.getElementById('showHere').innerHTML = thing; } </script> </head> <body> <select> <option>Choose One</option> <option onclick="me('00');">zero</option> <option onclick="me('11');">non-zero</option> </select> <br /><br /><br /><br /> <div id="showHere" >Watch this space</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.