[eluser]bas_vdl[/eluser]
i have a file form_validation.php. at the moment a user has filled in a text field i will check with jquery if it filled in right.
so i thought, if i can read the validation rules from out of the form_validation file and put them in a HTML attribute i can read this and check in my javascript file.
so maybe it is a good idea at the moment that the form_helper the text field build he grabs the validation rules that belongs to the text field and pass them in a html attribute.
so you get something similar like: <input name="firs_name" validation="required|alpha" />
with the unblur function i can pass the validation attributes en chec live if a field is filled in correctly.
Code:
<?php
$config = array(
'login' => array(
array(
'field' => 'username',
'label' => 'gebruikersnaam',
'rules' => 'required'
),
array(
'field' => 'password',
'label' => 'wachtwoord',
'rules' => 'required|md5'
)
)
)
?>