Skip to main content
Known Participant
July 22, 2009
Question

Passing/Inserting Checkboxes

  • July 22, 2009
  • 2 replies
  • 553 views

Hi everyone.

I have a very simple form with 36 checkboxes, one of which is initially checked. The other 35 are unchecked by default. I have created similar forms many, many times without an issue. For some reason, every time I submit the form, I get a 500 Internal Server Error. Here's what the code looks like for the checked checkbox, an unchecked checkbox, the action, and the insert:

Initially checked:

<input name="Email" type="checkbox" id="Email" value="-1" checked="checked" />

Unchecked by default:

<input name="Art" type="checkbox" id="Art" value="-1" />

Action code:

<cfif not isdefined("Form.Email")>
   <cfset Form.Email = "0">
</cfif>

<cfif not isdefined("Form.Art")>
   <cfset Form.Art = "0">
</cfif>

Insert code:

(Email,Art)

VALUES ('#Form.Email#','#Form.Art#')

I've tried everything, and like I said, I've built forms like this before without an issue. Any help would be GREATLY appreciated.

    This topic has been closed for replies.

    2 replies

    straffenpAuthor
    Known Participant
    July 22, 2009

    Thanks, Dan. It was actually something so simple as not having Friendly HTTP Errors Messages turned off. I had a field named incorrectly, and that took care of the problem.

    Thanks again.

    Inspiring
    July 22, 2009

    On your action page, put <cfdump var="#form#"><cfabort> at the top of your page.  Then start moving that code down the page until it crashes.  That will pinpoint where the problem is occurring.