Welcome Guest, Not a member yet? Register   Sign In
jquery post & ci form validation
#5

[eluser]yesov[/eluser]
to Nick: i know about create a custom validation rules, but i want to use "standart",
for example: "trim|required|min_length[5]|max_length[12]|xss_clean"
Code:
...
$data = json_decode($this->input->post('a'));
...
and after this $data is
Code:
Array
(
    [0] => stdClass Object
        (
            [link] => http://example.com
            [title] => test web page
        )

)

and i interesting, can i use "standart" ci validation for my object properties (link, title ....) ?
and can i use this code for validate ? (and what in $fields array?)
Code:
$rules = array(
    "title" => "min_length[10]"
);
$fields = array(
    "" => ""
);
$this->validation->set_rules($rules);
$this->validation->set_fields($fields);

if ($this->validation->run()) {
    $result =  .... ?
}

sorry for my english Wink


Messages In This Thread
jquery post & ci form validation - by El Forum - 01-21-2009, 08:00 AM
jquery post & ci form validation - by El Forum - 01-21-2009, 10:11 AM
jquery post & ci form validation - by El Forum - 01-21-2009, 12:17 PM
jquery post & ci form validation - by El Forum - 01-21-2009, 02:15 PM
jquery post & ci form validation - by El Forum - 01-22-2009, 03:06 AM
jquery post & ci form validation - by El Forum - 01-22-2009, 09:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB