It doesn't look like you are using the Validate plugin in the way it's
intended. You might want to have a look at the plugin's home page for more
information on its usage.
Your submit function should look something like:
$("#register").submit(function() {
$(this).validate(options);
});
...where options contains the Validation configuration object, which is
where validation rules, messages, and error placements are set up.
-- Josh
----- Original Message -----
From: "choffman" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Thursday, November 01, 2007 9:58 AM
Subject: [jQuery] Form function no firing
Hi There,
I could use some jquery help here. Its probably something very simple
that I'm missing. I started using jquery a few weeks ago so please
bear with me.
In a nut shell, when a user submits the form (form id="register"), I
want it check to make sure they have selected a radio button
(class="amount"). If they forgot, I want it turn the #billing id (<h2
id="billing>) red. I have server side validation working using PHP.
This is more of a visual indicator. I'm using the validate.js plug-in
and jquery 1.2.1. Any help would be great!
$(document).ready(function() {
$("#register").submit( function() {
checkRadio();
});
function checkRadio() {
$('input.amount').each(function() {
if ($('input:unchecked')) {
$("#billing").css('color', '#658300').show();
return true;
} else {
$("#billing").css('color', '#C60006').show();
return false;
}
});
//close function
};
});