Solved

form.submit on change not working!

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

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'…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

777 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