PHP Classes

JavaScript Validation

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  JavaScript Validation  >  (Un) Subscribe thread alerts  
Subject:JavaScript Validation
Summary:Clientside Validation Test
Messages:3
Author:James
Date:2010-03-25 00:06:16
Update:2010-03-25 13:32:23
 

  1. JavaScript Validation   Reply   Report abuse  
Picture of James James - 2010-03-25 00:06:16
I have the following javascript function fire when a specific submit is clicked. It changes the opacity of the viewport and displays an image telling the user to wait while the form is processed serverside. It works, but I only want it to fire if the form passes clientside validation. How do I check that the clientside passed validation?

$(function($)
{
$('#get_numbers').click(function()
{
$.blockUI(
{
message: '<h1><img src="/path/to/image/busy.gif" /> Please wait...<\/h1>',
timeout: 0
});
});
});

  2. Re: JavaScript Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-03-25 01:28:37 - In reply to message 1 from James
You can use the fake event variable ONSUBMITTING . You can assign Javascript code to it that will be executed during the ONSUBMIT event check, only if the form is valid, right before it is submitted.

  3. Re: JavaScript Validation   Reply   Report abuse  
Picture of James James - 2010-03-25 13:32:23 - In reply to message 2 from Manuel Lemos
Perfect!

Thank you!