Solved

Using onChange to submit form

Posted on 2004-09-17
1
209 Views
Last Modified: 2010-04-06
Hello,
I know this should be easy but I'm missing something.

I have a form like this:

    <SELECT NAME="team" onChange="submit">
            <OPTION value="Rams">Rams
            <OPTION value="Bears">Bears
            <OPTION value="RumRasin">Colts
            <OPTION value="Packers" selected>Packers
    </SELECT>

This select is actually one of 5 on the page and each select MUST go to the DB to retrieve some data.  So the first SELECT builds the menu for the second SELECT.  Right now I have OK buttons to SUBMIT but I want to change the page so that the form is automatically submitted to the action page when a user makes a selection.

This actually may be all it takes as far as the tag is concerned but what I'm missing is a javascript to go along with the onChange="submit" that I put into the SELECT.

Thanks, Jerry
0
Comment
Question by:geraldw
1 Comment
 
LVL 15

Accepted Solution

by:
joeposter649 earned 125 total points
ID: 12087423
Are you looking for this?
<SELECT NAME="team" onchange="this.form.submit();">
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question