Sweetalert: Multiple Checkboxes

Created on 9 Jun 2018  路  2Comments  路  Source: t4t5/sweetalert

Hey,

Is there a way to add Multiple Checkboxes in an Alert?

Most helpful comment

Hi brother,
I made that example here.
See if it helps.

```
Swal.fire({
title: 'Particularidade',
html: '

Alcool

' +
'

Cigarro

',
confirmButtonText: 'confirmar',
preConfirm: () => {
var alcool = Swal.getPopup().querySelector('#alcool').checked
var cigarro = Swal.getPopup().querySelector('#cigarro').checked
console.log("Alcool = " + alcool + " Cigarro = "+ cigarro)

        return {alcool: alcool, cigarro: cigarro}
      }
    }).then((result) => {
      Prescricao.usoAlcoolica = result.value.alcool
      Prescricao.usoCigarro = result.value.cigarro
      Swal.fire(`Babe?: ${result.value.alcool}\nFuma?: ${result.value.cigarro}`)
    })

All 2 comments

Hi brother,
I made that example here.
See if it helps.

```
Swal.fire({
title: 'Particularidade',
html: '

Alcool

' +
'

Cigarro

',
confirmButtonText: 'confirmar',
preConfirm: () => {
var alcool = Swal.getPopup().querySelector('#alcool').checked
var cigarro = Swal.getPopup().querySelector('#cigarro').checked
console.log("Alcool = " + alcool + " Cigarro = "+ cigarro)

        return {alcool: alcool, cigarro: cigarro}
      }
    }).then((result) => {
      Prescricao.usoAlcoolica = result.value.alcool
      Prescricao.usoCigarro = result.value.cigarro
      Swal.fire(`Babe?: ${result.value.alcool}\nFuma?: ${result.value.cigarro}`)
    })

Please add native support for this given a list of options, it should be doable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

voodoo6 picture voodoo6  路  4Comments

jamieson99 picture jamieson99  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  4Comments

Untit1ed picture Untit1ed  路  5Comments

daftspunk picture daftspunk  路  4Comments