What\'s the best way to trigger errors on elements for server-side validation errors that come back after the form passes the initial client-side validation?
$(\
On submit of the form, I would make the target of the form an invisible iframe on the page which would then call a function in the topWindow with it's result.
then in the page in the iframe call a javascript method in the top window that either redirects on success or displays the errors.
In the iframe
In the top window (as an example)
function uploadComplete( result ){
$.unblockUI();
if(result == "OK"){
$.blockUI({ message: "File upload successful, request submitted.
Redirecting..." });
setTimeout(function() {
$.unblockUI({
onUnblock: function(){ window.location='thankyou.php'; }
});
}, 2000);
} else {
$.blockUI({ message: "Failed.
"+result });
$('.blockOverlay').attr('title','Click to remove').click($.unblockUI);
}
}