[eluser]coolgeek[/eluser]
That's not it... you'll note that my controller calls a model to insert a record and the record does in fact insert, with a value of 'test award'.
In fact, this silly callback function was created in order to try to debug my real problem, which is with form_dropdown. I have another callback function:
Code:
function date_check () {
if (isset($_POST['month']) && isset($_POST['day']) && isset($_POST['year'])
&& $_POST['month'] != 0 && $_POST['day'] != 0 && $_POST['year'] != 0) {
if (checkdate($_POST['month'], $_POST['day'], $_POST['year']))
return TRUE;
else
{
$this->form_validation->set_message('date_check', 'The date field is invalid');
return FALSE;
}
}
else
{
$this->form_validation->set_message('date_check', 'The date field is invalid');
return FALSE;
}
}
that I'm calling as such (in the controller)
Code:
$this->form_validation->set_rules('year', 'Year', 'trim|required|xss_clean|callback_date_check');
I'm setting the form_input field to 'test award', and not setting the form_dropdown fields at all. When I click the submit button, not only is the record being created with the name 'test award', but the date is being set to '0000-0-0'
For all intents and purposes, the callback_award_check was copied directly from the Form Validation doc page, which is why I find this so frustrating
EDIT: fwiw, here is the generated html
Code:
<div id="award" class="inputformtext"><p>Award:<input type="text" name="award" value="" size="" />