Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   form submission with Javascript (http://www.programmingforums.org/showthread.php?t=12205)

ktsirig Dec 18th, 2006 5:19 PM

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!

DaWei Dec 18th, 2006 5:27 PM

Well, you need to learn Javascript. Check out events, such as onclick (), onchange (), onmouseover (), etc.

pushkarajthorat Dec 26th, 2006 4:20 AM

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,

Arevos Dec 26th, 2006 7:04 AM

You can also refer to forms by their name:
:

  1. document.forms.your_form_name.submit();



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