Onchange="this.form.submit();"

Has anyone had a simple select statement within a form with an Onchange=“this.form.submit();” not submit the form when the value is changed?

I have 2 other forms within the same page with Onchange=“this.form.submit();” that work.

I’ve tried specifically naming the form with an id and using getelementbyid to submit the form, modifying the form name and submitting it with that specific form name, creating a javascript function to submit the form and other options that will submit forms.

I’m pulling my hair out! It’s simple html code that should work 100% of the time.

Below is the piece of code that pertains to this form and select statement.

Dale

<table width="100%">
<form name="form" method="post"  action="">
<cfoutput>
  <input name="pafnumber" type="hidden" value="#form.pafnumber#">
  <input name="positionnumber" type="hidden" value="#form.positionnumber#">
  <input name="paftype" type="hidden" value="#form.paftype#">
  <cfif form.pafnumber neq "">
  <tr>
    <td width="50%" nowrap="nowrap"><div align="right"><strong>PAF Number:</strong></div></td>
    <td width="50%"nowrap="nowrap">#recordset1.pafnumber#</td>
  </tr>
  </cfif>
  
 
  <cfif form.pafnumber neq "">
  <tr>
    <td width="50%" nowrap="nowrap"><div align="right"><strong>EPAF Type:</strong></div></td>
    <td width="50%">#recordset1.pafdescription#</td>
  </tr>
  </cfif> 
  <tr>
  <td width="50%" nowrap="nowrap"><div align="right"><strong>Appointment Type:</strong></div></td>
  <td width="50%">
 <select name="appointmenttype" onchange="this.form.submit();">
  <option value="">Select Appointment Type</option>
  <cfoutput query="getappt">
  <option value="#getappt.appointmenttype#" <cfif getappt.appointmenttype eq "#recordset1.appointmenttype#"> selected </cfif>>#getappt.appointmentdescription#</option>
  </cfoutput>
  </select>
  </td>
</tr>
  
   <tr>
  <td width="50%" nowrap="nowrap"><div align="right"><strong>First Name:</strong></div></td>
  <td width="50%" nowrap="nowrap"><input name="firstname" type="text" value="#recordset1.firstname#" onselect="this.form.submit();" ></td>
  </tr>
  
  <tr>
  <td nowrap="nowrap"><div align="right"><strong>Last Name:</strong></div></td>
  <td><input name="lastname" type="text" value="#recordset1.lastname#"/></td>
  </tr>
</cfoutput> 

<cfoutput>
<tr>
<td nowrap="nowrap"><div align="right"><strong>Effective Date:</strong></div></td>
<td><input name="dateofactionfrom" id="dateofactionfrom" type="text" value="#dateformat(recordset1.dateofactionfrom,'mm/dd/yyyy')#"/></td>
</tr>



<cfif form.pafnumber neq "">

<cfif form.paftype eq 'LV' or form.appointmenttype eq 'TEMP'>
<tr>
<td nowrap="nowrap"><div align="right"><strong>End Date:</strong></div></td>
<td><input name="dateofactionto" id="dateofactionto" type="text" value="#dateformat(recordset1.dateofactionto,'mm/dd/yyyy')#"/></td>
</tr>
</cfif>
<tr>
  <td valign="top">&nbsp;</td>
  <td valign="top">&nbsp;</td>
</tr>
<tr>
  <td valign="top"><div align="right"><strong>Comments:</strong></div></td>
  <td valign="top"><textarea name="comments" cols="50" rows="4">#tostring(Recordset1.comments)#</textarea></td>
</tr>
</cfif>
<tr>
  <td colspan="2">&nbsp;</td>
</tr>
</cfoutput>
<tr>
<td colspan="2">
<div align="center">
<cfif form.pafnumber eq "">
<input name="submit" type="submit"  value="Create PAF"/>
</cfif>
<cfif form.pafnumber neq "">
<input name="submit" type="submit"  value="Update"/>
</cfif>
</div>
</td>
</tr>
<tr>
  <td colspan="2">&nbsp;</td>
</tr>
</form> 
</table>