November 24, 200817 yr hello.. i have a form with several checkboxes available for each hotel room night: Nite_1_Check Nite_2_Check ... if i submit the form WITH a box checked, no problem. If i don't select the box and submit, it errors out "Notice: Undefined index: Nite_1_Check... Here's what i started with: $edit->setField('Nite_1_Check', $_POST['Nite_1_Check']); when that didn't work (if unchecked), i tried several variations of: if ($_POST['Nite_1_Check'] != NULL) { $edit->setField('Nite_1_Check', $_POST['Nite_1_Check']); } else { $edit->setField('Nite_1_Check', NULL); } but that doesn't work. Since all of my other (non- checkbox) fields work fine, i have a feeling this has something to do with PHP not being able to send/POST a NULL value(?). Am i approaching this right? thanks..
November 24, 200817 yr Author got it.. i had to use an "isset" if (isset($_POST['Nite_1_Check'])) { $edit->setField('Nite_1_Check', $_POST['Nite_1_Check']); } else { $edit->setField('Nite_1_Check', NULL); } works great.. hooray for trial/error :
Create an account or sign in to comment