Check box is checked

edited May 2012 in Modules
I have put a checkbox at the side of a field i.e an image. The checkbox is labeled delete, once this is checked I would like to run a query to delete a field record i.e an image. How would I check to see if the checkbox is checked?

// Value of the checkbox field

if($data['image1_delete']==1) { "Run the query?" }

would this be something I would have to do using on_after_post?

Thanks

Comments

  • edited 5:33AM
    Yes. Unchecked checkboxes don't get sent across in the $_POST (nor do multiple select boxes that don't have anything checked), so you'll need to check to see if the $_POST variable exists
Sign In or Register to comment.