validate: function () {
contact.message = '';
if (!$('#contact-container #contact-name').val()) {
contact.message += 'Name required. ';
}
if (!$('#contact-container #contact-phone').val()) {
contact.message += 'Phone required. ';
}
[B]if (!$('#contact-container #contact-phone').length()<>10) {
contact.message += 'Phone no should be of 10 digit. ';
}[/B]
var email = $('#contact-container #contact-email').val();
if (!email) {
contact.message += 'Email required. ';
}
else {
if (!contact.validateEmail(email)) {
contact.message += 'Invalid email ';
}
}
if (!$('#contact-container #contact-message').val()) {
contact.message += 'Msg required.';
}
if (contact.message.length > 0) {
return false;
}
else {
return true;
}
},
jacob21 0 Posting Whiz in Training

stbuchok
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.