Here's the situation:
I'm using jquery.validate.js to validate my forms, but I need to add a server-side validation layer. jQuery Validate uses class names within form-elements to determine what it should do -- I want to fetch those class names into PHP so that I can perform the same validations on the server-side.
I'm hoping to do something like this:
foreach($_POST as $key=>$value) {
$class=array(...// get this #key element class name list with jQuery
$error=...// based on the class names, perform specific PHP validations
if($error=="")
return true;
else
return false;
}
Question is, can I do this? Can I fetch element class names w/ jQuery and pass them to PHP?