Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get radio button value in SweetAlert with AngularJS #55

Open
essivision opened this issue Apr 25, 2016 · 3 comments
Open

How to get radio button value in SweetAlert with AngularJS #55

essivision opened this issue Apr 25, 2016 · 3 comments

Comments

@essivision
Copy link

I want to use Sweet Alert for get radio button value in Angularjs. Is there a way to get selected radio button value. I am using SweetAlert v1.1.3 anf ngSweetAlert directive.

SweetAlert.swal({
    title: "Please Select:",
    text: '<form> <div class=""> <input type="radio" name="csvSelect" id="radio1" ng-model="radioValue" ng-value="1" > <label for="radio1"> Whole records </label> </div> <div class=""> <input type="radio" name="csvSelect" id="radio2" ng-model="radioValue" ng-value="2" ng-click="getVal()"> <label for="radio2"> Selected records </label> </div></form>',
    html: true,
    showCancelButton: true,
    confirmButtonText: "Download it!",
    cancelButtonText: "Cancel",
    closeOnConfirm: false,
    closeOnCancel: true,
    showLoaderOnConfirm: true
},
function (isConfirm) {
    if (isConfirm) {
        SweetAlert.swal("Deleted!", $scope.radioValue, "success");
    }
});
@fedemenseguez
Copy link

I have the same issue trying to use a combobox.

@marvinhosea
Copy link

html is depreciated

@jeremylzn
Copy link

Simply to write the html inside the property "html"
It's work for me

var text_html = '

Whole records
Selected records
'
SweetAlert.swal({
title: "Please Select:",
html: text_html,
showCancelButton: true,
confirmButtonText: "Download it!",
cancelButtonText: "Cancel",
closeOnConfirm: false,
closeOnCancel: true,
showLoaderOnConfirm: true
},
function (isConfirm) {
if (isConfirm) {
SweetAlert.swal("Deleted!", $scope.radioValue, "success");
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants