Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Validation Re: Validation

#92090
Brightonmike
Member

That’s some great help and pointers there.

I could use the validation plugin – but to me it doesn’t make sense to add a lot of extra jQuery just because of one field. The current setup already handles validation for the rest of the fields – the problem is it only validates the fields when you advance slides.

Sure, the validation is pretty basic. At the moment it doesn’t make sure someone actually types an email address into the email field. But we never have that problem, so it doesn’t currently needs to be solved.

The code you’ve posted for the drop down select definitely looks right to me! So I will try that. The current plugin does already check for the required fields.

Edit, I have successfully got the drop down working. If I’d actually thought about my existing code for a second!!!


/* $(function() {
function checkMultiLeg(select_id){
if($('option:selected', select_id).val() == "Multi Leg"){
$('#Via').show();
$('#via').addClass('required')
} else {
$("#Via").hide();
$('#via').removeClass('required')
}
}

checkMultiLeg('#FlightType');

$("#FlightType").change(function(){
checkMultiLeg(this);
});
});
/* ]]> */