Solved

form.submit on change not working!

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

688 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