I have several text input fields in my page, and few radio buttons. Now I need to validate them at client side, before I send them to server side (having server side validation too).
I am validating text inputs using jquery and javascript, but now I am wondering is this really the best way to validate them?
And how is this going to work with radio buttons?
$('form').submit(function() {
validateForm($(this))
return false;
});
function validateForm(form) {
var FirstName=form.find('[name=FirstName]').val();
if (!FirstName) {
alert('Etunimi puuttuu');
return false;
}
}