Welcome Guest, Not a member yet? Register   Sign In
Problem with setting a default zero in form validation rule
#16

[eluser]CroNiX[/eluser]
You don't really need to do that in validation. You can cast it to an int.
Code:
$number = (int)$this->input->post('number_field');

If number_field doesn't exist in CI's post array, $number will be 0 because the value will be boolean FALSE which is int(0) and the same with an empty string.


Messages In This Thread
Problem with setting a default zero in form validation rule - by El Forum - 11-21-2012, 03:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB