Welcome Guest, Not a member yet? Register   Sign In
Protype ajax validation problem
#10

[eluser]Michael;[/eluser]
[quote author="mdowns" date="1218489673"]I don't think empty can check the return value of functions. You should use a variable instead.

Code:
$text = trim($this->input->post('value'));
if(empty($text))
{
    echo 'This field is required.';
}

Also how is this function being used? It's not returning anything.[/quote]

It's being used as an ajax call... " onblur="ValidateField(this, 'first_name', 'required')" ", so onblur it calls the javascript function ValidateField, which then makes a call to my ajax controller, which then accesses the validation library which is where this function is (" required "). Then the "print" is captured as AjaxResult.responsetext.

Evrything else works, I can validate numbers, email, even run things through the db ... ONLY empty fields is giving me issues.


Messages In This Thread
Protype ajax validation problem - by El Forum - 08-10-2008, 03:50 PM
Protype ajax validation problem - by El Forum - 08-11-2008, 08:45 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 08:58 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 09:19 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 09:38 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 09:52 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 10:04 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 10:21 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 10:23 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 10:45 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 11:25 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 11:51 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 11:53 AM
Protype ajax validation problem - by El Forum - 08-11-2008, 12:31 PM
Protype ajax validation problem - by El Forum - 08-11-2008, 12:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB