Welcome Guest, Not a member yet? Register   Sign In
Validate form with default values?
#5

[eluser]Sven Delle[/eluser]
Is it possible to have both a required and a callback at the same time somehow?

If I use a callback to check for existing username I cannot send any errors to the validator if the field is empty. I doesn't validate, but I'd like to send it the required error.

Any solution for that?

Well, yes:
Code:
$this->form_validation->set_rules('username', 'Username', 'required|callback_check_default_username');


Messages In This Thread
Validate form with default values? - by El Forum - 04-18-2012, 12:58 PM
Validate form with default values? - by El Forum - 04-18-2012, 04:49 PM
Validate form with default values? - by El Forum - 04-18-2012, 04:53 PM
Validate form with default values? - by El Forum - 04-18-2012, 05:39 PM
Validate form with default values? - by El Forum - 04-18-2012, 05:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB