简体   繁体   中英

Disable Radio Button once selected?

I have two radio buttons on my current page and need to disable the one that is selected so that it cannot be selected a second time. Can I add something before the break to disable the button.

switch(view.getId()){
            case R.id.radioButton:
                if(checked)
                    txt.setText(kmToM(dist));

                break;
            case R.id.radioButton2:
                if(checked)
                    txt.setText(mToK(dist));
                break;
        }

加上这个

$(YOUR_RADIO).attr("disabled","disabled");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM