Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49217

How to access values in a Radio Alert

$
0
0

@dimitri320 wrote:

I can’t get to use/access the selected Radio button/value in an Alert in the following code:

   let alert = this.alertCtrl.create({
        title: 'Specify the reason',
        inputs: [
          {
            type: 'radio',
            label: 'label 1',
            value: '0'
          },
          {
            type: 'radio',
            label: 'label 2',
            value: '1'
          }
        ],
        buttons: [
          {
            text: 'Cancel',
            role: 'cancel',
            handler: () => {
              console.log('Cancel clicked');
            }
          },
          {
            text: 'OK',
            handler: () => {
              console.log('OK clicked: ' );
              // I NEED TO GET THE VALUE OF THE SELECTED RADIO BUTTON HERE
            }
          }
        ]
      });
      alert.present();

Posts: 11

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 49217

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>