html - send data from select when option is selected with submit button -
html - send data from select when option is selected with submit button -
i have select dropdown
<select form="orderby" name="order" > <option value="name">name</option> <option value="rating">rating</option> <option value="likes">popularity</option> <option value="time">time</option> <option value="cost">cost</option> </select> <select form="orderby" name="sort" > <option value="asc">ascending</option> <option value="desc">descending</option> </select> <form style="display:inline-block" id="orderby" action="frapnel2.php"> <input type="hidden" name="city" value="<?php echo $city;?>" /> <input type="submit" value="go"/> </form> what happens after selecting alternative , hitting go phone call page new values , have want rid of pressing go every time. how do that?
the simplest solution add together onchange attribute <select> element submits form. eg:
<select form="orderby" name="order" onchange="form.submit()"> note:
there should submit button (on public web page), if don't think need one. cannot know certainty users browser execute scripts, or execute them correctly. there few things more annoying web forms cannot submitted.
the form=... attribute new in html5. some say not supported ie. best bet set form elements within <form>.
html
Comments
Post a Comment