cfform submission in a tabbed layout
I have an application which allows users to submit a benefits form.
Tab 1 shows forms which the logged in user has already submitted.
Tab 2 ("Create new form") contains a blank form. The form is loaded from a separate file, which has the entire form
<cflayoutarea title="Edit/Create New Application" name="tab2" selected="#mytab2#" source="appl_form.cfm">
I'm using cfform, as several of the fields are required, and I want to take advantage of the mask option.
I'm using a couple of different onchange javascript functions on many of the fields; one invokes ColdFusion.Ajax.submitForm to call a CFC calculator function to provide a running total as the user enters numbers, the other looks up some meta information and populates hidden form fields appropriately. All of that is working great.
When the user actually submits the form, I want to reload the entire page, so that the newly submitted data shows up on the list of submitted forms. I'm using the ColdFusion.navigate function for this.
<input id="submit" value="I Agree. Submit My Application." type="submit" onclick="javascript:ColdFusion.navigate('index.cfm',null,mycallBack,myError,'POST','tran_app');">
The problem I''m having is that the form will not submit properly unless I include an "onsubmit" function in the cform tag:
<cfform name="tran_app" id="tran_app" action="index.cfm" method="post" onsubmit="javascript:SubFrm()">
It doesn't actually use the function, in fact it throws a JS error:
Error: SubFrm is not defined
Source File: http://www.inside.dev.nsf.gov/CFIDE/scripts/ajax/package/cfajax.js
The function in question is in the parent page, along with all the other functions that are found.
HOWEVER, other than that thrown JS errror, the page works perfectly -- the data is submitted and the page redraws fine.
I have tried:
removing the onsubmit attribute from cfform
making the onsubmit call the same as the onclick in the submit button
removing everything except the id attibute from cfform
screaming
none of which worked, although the screaming made me feel a bit better.
There may be a sainthood involved for anyone who can help me with this.
