?
Solved

form.submit on change not working!

Posted on 2008-10-07
3
Medium Priority
?
447 Views
Last Modified: 2012-05-05
ok, what am I doing wrong???

<cfform name="form1" id="form1" method="post" action="">
      <cfselect name="company" id ="company" onchange="javascript:document.form1.submit(); ">
        <option value="<cfoutput>#form.company#</cfoutput>" selected="selected"><cfoutput>#form.company#</cfoutput></option>
        <cfoutput query="getcomps">      
          <option value="#company#">#company#</option>
        </cfoutput>
        </cfselect>
      <cfinput type="submit" name="submit1" value="submit" id="submit"/>
      </cfform>
0
Comment
Question by:judsonmusic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 22662223
submit is a reserved word. Do NOT use it as a name or id on any element.
change: 
      <cfinput type="submit" name="submit1" value="submit" id="submit"/> 
to: 
      <cfinput type="submit" name="submit1" value="submit" id="submit1"/>

Open in new window

0
 
LVL 5

Expert Comment

by:MMeijer
ID: 22662305
onchange="javascript:document.form1.submit();" is the IE only approach..
try
onchange="javascript: document.forms['form1'].submit();"
or
onchange="javascript: document.getElementById('form1').submit();"
0
 
LVL 82

Expert Comment

by:hielo
ID: 22668858
glad to help.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

765 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