Question

  • Creator
    Topic
  • #2143565

    JS – multiple Val on Change

    by lyounkins ·

    Trying to write JS with on Change with multiple values. Problem, PaperApplication will not hide. I need Social field to show, if they have a SSN, and to hide if not, AND if not, to show 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 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();
    }
    });

You are posting a reply to: JS – multiple Val on Change

The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our Community FAQs for details. All submitted content is subject to our Terms of Use.

All Answers

Share your knowledge