Forum Moderators: coopster

Message Too Old, No Replies

get values from combobox without through the submit button

how to get values from combobox without through the submit button?

         

Yuen

4:31 am on Apr 8, 2009 (gmt 0)

10+ Year Member


anny can help!

<form name="reservation" method="post" action="">
<tr>
<td width="8%">Room</td>
<td width="3%">:</td>
<td width="89%"><select name="room_no">
<option value="1001">1001</option>
<option value="1002">1002</option>
<option value="1003">1003</option>
<option value="1004">1004</option>
<option value="1005">1005</option>
<option value="1006">1006</option>
<option value="1007">1007</option>
<option value="1008">1008</option>
<option value="1009">1009</option>
<option value="1010">1010</option>
</select>
</td>
</tr>
<?php

/*how to get values without using the submit button in php code? please help*/
?>

coopster

10:18 am on Apr 8, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Yuen.

Are you asking how you can make it so that any change to the selected value will submit the form automatically? You cannot do that in PHP, you need to use JavaScript. You add an "onchange" event handler to the <select> element.

Yuen

6:15 pm on Apr 8, 2009 (gmt 0)

10+ Year Member



thanks..
erm..
can u so me the code..hehe...
coz..not really understand
thanks for u help ya?

coopster

8:03 pm on Apr 8, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You haven't really answered my question yet ... is what I described what you are suggesting you want to do?