尝试使用具有多个值的on Change编写JS。问题,PaperApplication将不会隐藏。我需要显示“社交”字段(如果它们具有SSN),如果没有,则隐藏,如果没有,则隐藏,以显示PaperApplication。
$('.field.SocialSecurity input[type=radio]').on("change", function()
{
if($(this).val() == 'As a U.S. Citizen, permanent resident, or temporary working resident, I have
a Social Security Number.')
{
$('field.SSN').show();
$('.field.SSN input').focus();
}
else if($(this).val() == 'Due to my international student status, my residency status, or my s .
specific visa type, I do not have a Social Security Number.')
{
$('field.PaperApplication').show();
$('.field.PaperApplication input').focus();
$('fieldset.SSN').hide();
}
else
{
$('fieldset.PaperApplication').hide();
}
});