![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 3
![]() |
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! |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Well, you need to learn Javascript. Check out events, such as onclick (), onchange (), onmouseover (), etc.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Java Developer
|
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, Last edited by pushkarajthorat; Dec 26th, 2006 at 3:54 AM. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
You can also refer to forms by their name:
javascript Syntax (Toggle Plain Text)
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FFT DWTIB -> Optimization -> Choosing An Appropriate Run Time | Sane | Software Design and Algorithms | 7 | Dec 1st, 2006 10:40 AM |
| Show or hiding forms/modifying control properties ..from different a form.. | cloud- | C# | 4 | Nov 10th, 2006 10:51 AM |
| Javascript: form processing, component name - variable | Druid | JavaScript and Client-Side Browser Scripting | 8 | Mar 16th, 2006 5:23 PM |
| .NET Timer Form closing issue | MBirchmeier | C# | 4 | Nov 21st, 2005 10:00 AM |
| entering data into excel from a form | glevine | Perl | 1 | Nov 18th, 2005 5:03 PM |