Checking and unchecking radio buttons with Jquery Mobile

后端 未结 5 1358
说谎
说谎 2021-01-02 09:03

I can\'t check a set of checkboxes programatically with jquery mobile, I have the following code:

相关标签:
5条回答
  • 2021-01-02 09:28

    For me works this to uncheck the whole group of radios:

    $(".my_class").removeAttr("checked");
    $(".my_class").checkboxradio("refresh");
    
    0 讨论(0)
  • 2021-01-02 09:44

    This doesn't seem right. The single quote is not needed input[type=radio] is correct. I'm using an outdated version (1.1.1). It would be help to know what version you're using.

    Keep in mind that those are radio buttons, only one selected at a time.

    0 讨论(0)
  • 2021-01-02 09:44

    in Jquery mobile radio button refresh like this:

    $(".iscfieldset input[type='radio']:first").attr("checked", "checked");
    
    
        $(".iscfieldset input[type='radio']").checkboxradio().checkboxradio("refresh"); 
    

    try this working fine for me

    0 讨论(0)
  • 2021-01-02 09:45

    Nothing worked for me except:

    $('#reset').click(function(){
        $('#Store').trigger("click").trigger("click"); // yes... twice
    });
    

    On jQuery Mobile 1.4.2.

    0 讨论(0)
  • 2021-01-02 09:51

    They all work just fine. You just need to trigger refresh on all input radio in group.

    $("input[type='radio']:first").attr("checked", "checked");
    $("input[type='radio']").checkboxradio("refresh");
    

    jsFiddle is here.

    0 讨论(0)
提交回复
热议问题