Passing Form Errors
Posted: Tue Aug 05, 2008 2:24 pm
What's the easiest way to pass form validation errors back to the user. I have a simple ajax script that displays errors on the same page above the form after it's been submitted and validated by register.php. Is there another way to do keep the errors on the same page above the form that wouldn't involve ajax? Also, to validated a user's login information I return the errors using $_GET i.e (reg.php?msg=1) then I just have it echo a simple error if it's found.. is this a decent way to do things? I think it look sloppy passing the errors using $_GET. Perhaps someone could point me in the direction of a simple ajax error display script that is simple and clean. I use this one currently w/ mootools:
Thanks!
Code: Select all
<script type="text/javascript">
window.addEvent('domready', function(){
$('memberForm').addEvent('submit', function(e) {
new Event(e).stop();
var log = $('dispErrors').empty().addClass('ajax-loading');
this.send({
update: log,
onComplete: function() {
log.removeClass('ajax-loading');
}
});
});
});
</script>