jvcgamer Posted November 1, 2009 Share Posted November 1, 2009 Hello, im here to ask for help. I need to know how to do when a player picks an option from a Option selecting menu a dialog box or text area apears for him to write text. Example <p>Packs: <select name="packs" size="1"> <option value=" Basic ">Basic</option> <option value=" Profecional ">Profecional</option> <option value=" Gold ">Gold</option> <option value=" Pay Per Slot ">Pay Per Slot</option> </select> If the person chooses Pay Per Slot , a text area or box apears and there the person enters the digits of slots etc.. , but only for that option. Not for the other ones. If any one could help i would apreciate it. btw, sorry for my bad english. Im spanish speaking Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/ Share on other sites More sharing options...
Amtran Posted November 1, 2009 Share Posted November 1, 2009 Probar esta, (try this ) <script type="text/javascript"> function selectFunction(select_value) { if (select_value == 'Pay Per Slot') { document.getElementById('makenewtextbox').innerHTML = '<input type="text" name="textbox">'; } } </script> <select onselect="selectFunction(this.value)"> <option value="Basic">Basic</option> <option value="Profecional">Profecional</option> <option value="Gold">Gold</option> <option value="Pay Per Slot">Pay Per Slot</option> </select> <span id="makenewtextbox"></span> Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948560 Share on other sites More sharing options...
jvcgamer Posted November 1, 2009 Author Share Posted November 1, 2009 Thanks for the reply but its not working. Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948564 Share on other sites More sharing options...
Amtran Posted November 1, 2009 Share Posted November 1, 2009 Hmm, are you sure you copied everything exactly? I just tested it and it worked for me. Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948565 Share on other sites More sharing options...
jvcgamer Posted November 1, 2009 Author Share Posted November 1, 2009 Hmm, are you sure you copied everything exactly? I just tested it and it worked for me. Yes i did, I even copied and created a hole new php file, can i give link? or is it consider spam Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948566 Share on other sites More sharing options...
Amtran Posted November 1, 2009 Share Posted November 1, 2009 As far as I know, it's okay to post links in this forum. Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948568 Share on other sites More sharing options...
jvcgamer Posted November 1, 2009 Author Share Posted November 1, 2009 Well i tested it out here: www.onegamerz.com/ordenar/test.php Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948569 Share on other sites More sharing options...
Amtran Posted November 1, 2009 Share Posted November 1, 2009 Ohhhhhhhhhh! How dumb of me Change: <select onselect="selectFunction(this.value)"> To: <select onChange="selectFunction(this.value)"> Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948573 Share on other sites More sharing options...
jvcgamer Posted November 1, 2009 Author Share Posted November 1, 2009 It worked for a simple .php file but once i added to my page it dint work. It shows a small box next to each selection but no able to insert text the page is: http://www.onegamerz.com/ordenar/ where it sais Basico etc.. Link to comment https://forums.phpfreaks.com/topic/179797-help-with-on-player-select-an-option-a-text-area-or-dialog-box-apears-to-write/#findComment-948577 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.