How to do a background check only some of the fields in the form?
for example, there is in the admin panel, a few fields, username, email, password
But if I filled out the field password, then you need to check this field, and if the field is not filled, then no need to update the data in the database
how to do it?
here is my html form ....
<div class="control-group">
</div>
users controller
$val = Model_User::validate('edit');
if (\Input::method() == 'POST')
{
if ($user->email == \Input::post('email'))
{
$val->field('email')->delete_rule('unique');
}
if ($val->run(null, true))
{ ....
I know that you can do something like so
if ($val->run(array('password' => null), true))
{ ....
but if a lot of fields, may have some ability to disable the audited field
It looks like you're new here. If you want to get involved, click one of these buttons!