Hello!
I am searching over the net for quite a long, but I have almost no idea concerning Javascript so I can't figure out the solution to my problem...
I have a form that show a drop-down menu, which takes all its values through a Mysql database via PHP. What I want to do is to submit the form to the next page (from index.php ---> retrieve_data.php) without the need of a "Submit" button.
When the user selects one of the given options, automatically he will be redirected to retrieve_data.php?id=5 for example...
Thank you in advance!






andy206uk posted this at 23:44 — 18th December 2006.
He has: 1,754 posts
Joined: Jul 2002
I think this will do what you need:
<form method="get" action="whatever.php"><select name="name" onchange="javascript:this.form.submit();">
<option value="value">name</option>
<option value="value"> name </option>
<option value="value"> name </option>
<option value="value"> name </option>
<option value="value"> name </option>
</select>
<noscript><input type="submit" value="go!"></noscript>
</form>
'
just add onchange="javascript:this.form.submit();" to your select box. (be sure to put a submit button in the tags though, incase javascript is disabled!)
Andyk
Blog of a Web Designer
Give a man a fish and you feed him for a day. Teach him to use the Net and he won't bother you for weeks.