- items, and updating the select box. Only problem is that sometimes one of my options isn't clickable - I think jQuery still thinks it's selected (even though I've changed the class and the select value) and so is returning "false". I have to click onto another option and then back onto it again in order to select it.
Any tips?
Here's my JS:
function showHide(){
if($(".field_17 select").val()=='Yes')
{
$(".field_18").show();
if($(".field_18 select").val()=='Yes')
{
$(".field_19").show();
}
else
{
$(".field_19").hide();
$(".field_19 li:contains('--')").click();
$(".field_19 li").removeClass('selected');
$(".field_19 li:contains('--')").addClass('selected');
$(".field_19 select").val('--');
}
}
else
{
$(".field_18").hide();
$(".field_18 li:contains('--')").click();
$(".field_18 li").removeClass('selected');
$(".field_18 li:contains('--')").addClass('selected');
$(".field_18 select").val('--');
}
}
$(document).ready(function() {
showHide();
$("select").change(function(){
showHide();
})
});
There are three fields, all "Yes/No". There's a third option "--" which is hidden on the front end - that's the default option.
You should only see field 18 if field 17 is "yes", and only field 19 if field 18 is "yes".
Loading Profile...


Twitter,
Facebook, or email.

EMPLOYEE
