Note that there are some explanatory texts on larger screens.

plurals
  1. POInternet Explorer Form Submission issues with Coldfusion
    text
    copied!<p>I have a cfform with two submit buttons, the logic in my action page works perfectly fine with safari, chrome, FF, and IE9. But IE8 and less are having issues.in IE8 or less for some reason it can’t seem to send the action page the value of the submit button, so it never makes it inside any of my if statements.</p> <p>Form Code:</p> <pre><code>&lt;cfform action="appQuery.cfm?loc=personal" method="post" data-ajax="false"&gt; &lt;label for="fName"&gt;First Name&lt;/label&gt; &lt;cfinput type="text" name="fName" value="#fName#" style="width: 200px;"&gt;&lt;br&gt; &lt;label for="MI"&gt;Middle Initial&lt;/label&gt; &lt;cfinput type="text" name="MI" value="#MI#" maxlength="1" style="width: 40px;"&gt;&lt;br&gt; &lt;label for="lName"&gt;Last Name&lt;/label&gt; &lt;cfinput type="text" name="lName" value="#lName#" style="width: 200px;"&gt;&lt;br&gt; &lt;label for="dob"&gt;Date Of Birth Ex. 03/13/94&lt;/label&gt; &lt;cfinput type="text" name="dob" maxlength="8" value="#dob#" style="width: 100px;"&gt;&lt;br&gt; &lt;fieldset data-role="controlgroup" data-type="horizontal" &gt; &lt;legend&gt;Gender&lt;/legend&gt; &lt;label for="1"&gt;Female&lt;/label&gt; &lt;input type="radio" value="Female" name="gender" id="1" &lt;cfif #gender# eq "Female"&gt;checked&lt;/cfif&gt; &gt; &lt;label for="2"&gt;Male&lt;/label&gt; &lt;input type="radio" value="Male" name="gender" id="2" &lt;cfif #gender# eq "Male"&gt;checked&lt;/cfif&gt;&gt; &lt;/fieldset&gt; &lt;div data-role="fieldcontain"&gt; &lt;label for="ethnicity" class="select"&gt;Choose Ethnicity&lt;/label&gt; &lt;select name="ethnicity" id="ethnicity" data-native-menu="false" data-inline="true" class="eth" onChange="change()"&gt; &lt;option value="Hispanic" &lt;cfif #Ethnicity# eq "Hispanic"&gt;selected&lt;/cfif&gt;&gt;Hispanic&lt;/option&gt; &lt;option value="African American" &lt;cfif #Ethnicity# eq "African American"&gt;selected&lt;/cfif&gt;&gt;African American&lt;/option&gt; &lt;option value="Asian/Pacific Islander" &lt;cfif #Ethnicity# eq 'Asian/Pacific Islander'&gt; selected&lt;/cfif&gt;&gt;Asian/Pacific Islander&lt;/option&gt; &lt;option value="Caucasian" &lt;cfif #Ethnicity# eq "Caucasian"&gt; selected&lt;/cfif&gt;&gt;Caucasian&lt;/option&gt; &lt;option value="Other" id="other"&gt;Other&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div id="ethCustom" style="visibility:hidden;" data-role="fieldcontain"&gt; &lt;label for="ethOther"&gt;Ethnicity&lt;/label&gt; &lt;cfinput type="text" name="ethOther" style="width: 200px;" /&gt;&lt;br&gt; &lt;/div&gt; &lt;cfinput type="submit" data-inline="true" value="Save and Contiune Later" name="submit" /&gt; &lt;cfinput type="submit" data-inline="true" value="Save and Contiune Now" name="submit" /&gt; &lt;/cfform&gt; </code></pre> <p>Action page:</p> <pre><code>&lt;cfif #URL.loc# eq "personal" AND #FORM.submit# eq "Save and Contiune Now"&gt; &lt;cfquery datasource="#dbname#" username="#dbuser#" password="#dbpass#" name="personal1"&gt; UPDATE student SET fName = '#FORM.fName#', lName = '#FORM.lName#', MI = '#FORM.MI#', dob = '#FORM.dob#', gender = '#FORM.gender#',&lt;cfif #FORM.ethnicity# eq "Other"&gt; Ethnicity = '#FORM.ethOther#'&lt;cfelse&gt; Ethnicity = '#FORM.ethnicity#'&lt;/cfif&gt; WHERE s_id = '#COOKIE.id#' &lt;/cfquery&gt; &lt;cflocation url="appProcess.cfm##contact" addtoken="no"&gt; &lt;cfelseif #URL.loc# eq "personal" AND #FORM.submit# eq "Save and Contiune Later"&gt; &lt;cfquery datasource="#dbname#" username="#dbuser#" password="#dbpass#"&gt; UPDATE student SET fName = '#FORM.fName#', lName = '#FORM.lName#', MI = '#FORM.MI#', dob = '#FORM.dob#', gender = '#FORM.gender#',&lt;cfif #FORM.ethnicity# eq "Other"&gt; Ethnicity = '#FORM.ethOther#'&lt;cfelse&gt; Ethnicity = '#FORM.ethnicity#'&lt;/cfif&gt; WHERE s_id = '#COOKIE.id#' &lt;/cfquery&gt; &lt;cflocation url="http://.com/logout.cfm" addtoken="no”&gt; &lt;/cfif&gt; </code></pre> <p>Is there a different way I could conditionally check for which submit button that was pressed that is IE friendly?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload