Skip to content

Can support for radio button groups be added?  #189

@CrankyDragon

Description

@CrankyDragon

I got it working on my by adding a case for radio where ever I saw checkbox, and adding:

radio:
        "<div class='radio'><label><input class='bootbox-input bootbox-input-radio' type='radio' /></label></div>",

and

if( typeof option.name !== 'undefined' ) {
    checkbox.find("input").attr("name", option.name);
}

In the checkbox render loop, so the following would work:

bootbox.prompt({
                message : "Select prompt", 
                title    : "Select prompt",
                inputType : 'radio',
                inputOptions : [
                    { text : 'yay', value: 'yay', name: 'yay_group'},
                    { text : 'nay', value: 'nay', name: 'yay_group'},
                ],
                callback : function(blah) {
                    console.log(blah)
                }
            });

http://jsfiddle.net/Uv38G/2/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions