Radio button, remove default value in JS

前提是你 提交于 2019-12-25 07:52:50

问题


I'm trying to figure out of this radio button is checked No or Yes or has not been checked yet..

<s:if test="%{! #session['_rbc_session_client_information_complete_prompted_']}">
        <div class="form-inline loba-radio-inline">
            <span><s:text name="applicantInfo.infoComplete.msg"/></span>
            <s:radio id="infoComplete" name="infoComplete" value="" 
            list="#{getText('rbc.no.key'):getText('rbc.no'),
            getText('rbc.yes.key'):getText('rbc.yes')}" />
        </div>
    </s:if>

I have a continue button on the same page that calls changeRBC_RIP_G04()

However, i keep getting false, even if nothing is selected, if i reverse the radio button order, i get true.. I want to know when its unchcked...

function changeRBC_RIP_G04() 
{   
    var selectedValue = $('input[name=infoComplete]:checked').val();
    if (selectedValue == 'false') 
    {
        $('#RBC-MSG-011-modal').modal('show');
    }else {

    window.location='rbcDetailPage?newApplication=true'+selectedValue;
    }
};

the S tages are from struts 2

来源:https://stackoverflow.com/questions/18992001/radio-button-remove-default-value-in-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!