Solved

form.submit on change not working!

Posted on 2008-10-07
3
441 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
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 500 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

757 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

22 Experts available now in Live!

Get 1:1 Help Now