Welcome Guest, Not a member yet? Register   Sign In
Form Validation: "matches" and NOT required
#3

[eluser]CroNiX[/eluser]
A way to get around that is to create dynamic validation rules, or a custom validation rule.

For dynamic, when creating your rules, do something like:
Code:
$first_field = $this->input->post('field_name');

if($first_field)
{
    //create your validation rule for 2nd field using matches to first field, and make it required
}
else
{
    //regular validation rules for 2nd field
}


Messages In This Thread
Form Validation: "matches" and NOT required - by El Forum - 10-20-2010, 08:20 AM
Form Validation: "matches" and NOT required - by El Forum - 10-20-2010, 09:46 AM
Form Validation: "matches" and NOT required - by El Forum - 10-20-2010, 01:36 PM
Form Validation: "matches" and NOT required - by El Forum - 10-20-2010, 02:41 PM
Form Validation: "matches" and NOT required - by El Forum - 10-21-2010, 01:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB