Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 18th, 2006, 5:19 PM   #1
ktsirig
Programmer
 
Join Date: Oct 2005
Posts: 54
Rep Power: 4 ktsirig is on a distinguished road
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!
ktsirig is offline   Reply With Quote
Old Dec 18th, 2006, 5:27 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Dec 26th, 2006, 4:20 AM   #3
pushkarajthorat
Java Developer
 
pushkarajthorat's Avatar
 
Join Date: Jun 2006
Location: Solapur, India.
Posts: 24
Rep Power: 0 pushkarajthorat is an unknown quantity at this point
Send a message via Yahoo to pushkarajthorat
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 4:54 AM.
pushkarajthorat is offline   Reply With Quote
Old Dec 26th, 2006, 7:04 AM   #4
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
You can also refer to forms by their name:
javascript Syntax (Toggle Plain Text)
  1. document.forms.your_form_name.submit();
Arevos is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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 11:40 AM
Show or hiding forms/modifying control properties ..from different a form.. cloud- C# 4 Nov 10th, 2006 11:51 AM
Javascript: form processing, component name - variable Druid JavaScript and Client-Side Browser Scripting 8 Mar 16th, 2006 6:23 PM
.NET Timer Form closing issue MBirchmeier C# 4 Nov 21st, 2005 11:00 AM
entering data into excel from a form glevine Perl 1 Nov 18th, 2005 6:03 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:28 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC