Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to submit a selected value without a submit button? [closed]

Tags:

javascript

php

I have this code

<Select>
<option value="-1">Select</option>
<option value="6">kasper </option> 
<option value="13">adad </option> 
<option value="14">3204 </option>                   
</select>

I am using this button to submit the selected choice of the user:

<input type="submit" name="pageaction" value="Select" />

When the user click on "Select" it will display information corresponding to his select.

Can it be without the button?

Regards to all,

like image 472
alkhader Avatar asked Mar 26 '12 10:03

alkhader


1 Answers

You can call function inside the select dropdown.

 <select id="sel_id" name="sel_name"  onchange="this.form.submit();">
<option value="-1">Select</option>
<option value="6">kasper </option> 
<option value="13">adad </option> 
<option value="14">3204 </option>                   
</select>
like image 78
Sarath Tomy Avatar answered Sep 29 '22 13:09

Sarath Tomy