У меня есть cfform с двумя кнопками отправки, логика на моей странице действий прекрасно работает с safari, chrome, FF и IE9.Но у IE8 и менее возникают проблемы. В IE8 или менее по какой-то причине он не может посылать странице действия значение кнопки отправки, поэтому он никогда не попадает в мои операторы if.
Код формы:
<cfform action="appQuery.cfm?loc=personal" method="post" data-ajax="false">
<label for="fName">First Name</label>
<cfinput type="text" name="fName" value="#fName#" style="width: 200px;"><br>
<label for="MI">Middle Initial</label>
<cfinput type="text" name="MI" value="#MI#" maxlength="1" style="width: 40px;"><br>
<label for="lName">Last Name</label>
<cfinput type="text" name="lName" value="#lName#" style="width: 200px;"><br>
<label for="dob">Date Of Birth Ex. 03/13/94</label>
<cfinput type="text" name="dob" maxlength="8" value="#dob#" style="width: 100px;"><br>
<fieldset data-role="controlgroup" data-type="horizontal" >
<legend>Gender</legend>
<label for="1">Female</label>
<input type="radio" value="Female" name="gender" id="1" <cfif #gender# eq "Female">checked</cfif> >
<label for="2">Male</label>
<input type="radio" value="Male" name="gender" id="2" <cfif #gender# eq "Male">checked</cfif>>
</fieldset>
<div data-role="fieldcontain">
<label for="ethnicity" class="select">Choose Ethnicity</label>
<select name="ethnicity" id="ethnicity" data-native-menu="false" data-inline="true" class="eth" onChange="change()">
<option value="Hispanic" <cfif #Ethnicity# eq "Hispanic">selected</cfif>>Hispanic</option>
<option value="African American" <cfif #Ethnicity# eq "African American">selected</cfif>>African American</option>
<option value="Asian/Pacific Islander" <cfif #Ethnicity# eq 'Asian/Pacific Islander'> selected</cfif>>Asian/Pacific Islander</option>
<option value="Caucasian" <cfif #Ethnicity# eq "Caucasian"> selected</cfif>>Caucasian</option>
<option value="Other" id="other">Other</option>
</select>
</div>
<div id="ethCustom" style="visibility:hidden;" data-role="fieldcontain">
<label for="ethOther">Ethnicity</label>
<cfinput type="text" name="ethOther" style="width: 200px;" /><br>
</div>
<cfinput type="submit" data-inline="true" value="Save and Contiune Later" name="submit" />
<cfinput type="submit" data-inline="true" value="Save and Contiune Now" name="submit" />
</cfform>
Страница действий:
<cfif #URL.loc# eq "personal" AND #FORM.submit# eq "Save and Contiune Now">
<cfquery datasource="#dbname#" username="#dbuser#" password="#dbpass#" name="personal1">
UPDATE student
SET fName = '#FORM.fName#', lName = '#FORM.lName#', MI = '#FORM.MI#', dob = '#FORM.dob#', gender = '#FORM.gender#',<cfif #FORM.ethnicity# eq "Other"> Ethnicity = '#FORM.ethOther#'<cfelse> Ethnicity = '#FORM.ethnicity#'</cfif>
WHERE s_id = '#COOKIE.id#'
</cfquery>
<cflocation url="appProcess.cfm##contact" addtoken="no">
<cfelseif #URL.loc# eq "personal" AND #FORM.submit# eq "Save and Contiune Later">
<cfquery datasource="#dbname#" username="#dbuser#" password="#dbpass#">
UPDATE student
SET fName = '#FORM.fName#', lName = '#FORM.lName#', MI = '#FORM.MI#', dob = '#FORM.dob#', gender = '#FORM.gender#',<cfif #FORM.ethnicity# eq "Other"> Ethnicity = '#FORM.ethOther#'<cfelse> Ethnicity = '#FORM.ethnicity#'</cfif>
WHERE s_id = '#COOKIE.id#'
</cfquery>
<cflocation url="http://.com/logout.cfm" addtoken="no”>
</cfif>
Есть ли другой способ, которым я мог бы условно проверить, какая кнопка отправки, которая была нажата, подходит для IE?