![]() |
form submission with Javascript
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! |
Well, you need to learn Javascript. Check out events, such as onclick (), onchange (), onmouseover (), etc.
|
hi,
i think this is a good sol. 1. have a form tag who submitting data to page retrieve_data.php. you might use method as either "post" or "get", have the id of form as "form_id" 2. enclose the select tag in form tag so that when you submit the data will pass on to next page.. 3. on the select tag use the event onChange() and put this thing.. onChange="document.getElementById("myHeader").submit();" Regards, |
You can also refer to forms by their name:
:
|
| All times are GMT -5. The time now is 1:35 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC