Solved

form.submit on change not working!

Posted on 2008-10-07
3
443 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

809 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