<cfif structkeyexists(form, "btnSubmit")> overridding
I have a form that submits to itself instead of an action page.
This is my submit button : <input type="submit" name="btnSubmit" style="width: 108px" value="Submit">
When the form is submitted, I check for the existence of the submit button and then do processing :
<cfif structkeyexists(form, "btnSubmit")>
<cftransaction>
<!--- Deteremine if any of the checkboxes were checked from the form. Since the checkboxes name is 'del=#urdn_number#',
check to see if the first four characters are 'Del_'. If it is, perform a loop and extract the the urdn number into
the variable select_urdn_number --->
<cfif isDefined("form.fieldnames") and mid(form.fieldnames,1,4) is "Del_">
<cfloop index="i" list="#form.fieldnames#" delimiters=",">
<cfset select_urdn_number = listlast(i,"_")>
I basically have rows of data and each row contains a checkbox and I process all the transactions simultaneously that are checked.
What is happening now is that it seems to be treating form.btnSubmit as a form variable and attempting to insert it into the table and it is blowing up.
When I did this using an action page, there was no need to check for form.btnSubmit and the inserts worked without any problems.
How can I get around this problems ?
