How can I display the selected value of the option using PHP?
For example I have this code:
<script language=javascript> function sevent() { var xx = document.xx.sbox; if(document.xx.sbox.selectedIndex != 0) alert("selected is "+xx.selectedIndex); else alert("None is selected"); } </script>
<form name=xx> <select name=sbox onChange="sevent()"> <option value="default">Select Option</option> <option value="option 1">option 1</option> <option value="option 2">option 2</option> </select> </form>
Here, it prompts whatever option you select. What I wanted to do is to display the value of the selected option using PHP. How can do it?
Thanks. ^_^
2009/8/16 Kathleen Borja jane88borj@yahoo.com:
How can I display the selected value of the option using PHP?
For example I have this code:
<script language=javascript> function sevent() { var xx = document.xx.sbox; if(document.xx.sbox.selectedIndex != 0) alert("selected is "+xx.selectedIndex); else alert("None is selected"); } </script>
<form name=xx> <select name=sbox onChange="sevent()"> <option value="default">Select Option</option> <option value="option 1">option 1</option> <option value="option 2">option 2</option> </select> </form>
Here, it prompts whatever option you select. What I wanted to do is to display the value of the selected option using PHP. How can do it?
$wgRequest->getVal( 'sbox' ) will return the selected value. <select>s are no different from textboxes in this respect.
Roan Kattouw (Catrope)
Thanks, Roan for all the help in my senior thesis! I really appreciated all of it. I finished working on my project last October 2009. I was able to finish it even though i'm only given less than five months to work on it. My project is actually running.
Thanks a lot! Happy New Year!
mediawiki-api@lists.wikimedia.org