Solved

Using onChange to submit form

Posted on 2004-09-17
1
205 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
Comment Utility
Are you looking for this?
<SELECT NAME="team" onchange="this.form.submit();">
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
The viewer will learn how to dynamically set the form action using jQuery.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now