[jQuery] Submit event
[jQuery] Submit event
Hi There,
I could use some jquery help here. This 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
};
});