[Seaside] How do I do a remote validation for jquery.validator.js
with a seaside component?
Tim Murray
tmurray at ecsorl.com
Thu Sep 30 16:49:47 UTC 2010
Hi List.
I am implementing server side form validations with the
jquery.validation.js plugin.
There are examples for doing a remote validation of a username to help
to ensure that they stay unique within a site.
I am now at the point where I want to write a Seaside "component" that
will respond to the jquery.validation remote call .
I am not sure how to approach this.
>From the internet, a typical example of a php implementation looks like
this:
<?
$email = $_GET['email'];
function isValidEmail($email){
return
eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,
3})$", $email);
}
if($email=="")
{
$errormsg="error1";
}
if(!isValidEmail($email) && $email!="")
{
$errormsg="error2";
}
echo $errormsg;
?>
I am wondering if I should intercept these on the initialRequest of my
applications custom WATask
MyWATask>>initialRequest
"new user registration ajax lookups"
(aRequest url pathString endsWith: '/jquniqueloginlookup')
ifTrue:[?????WHAT DO I DO????].
Thanks for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100930/cf244793/attachment.htm
More information about the seaside
mailing list