Ionic: how to handle change event radio button

#1

I want to show alert dialog when I click some radio button. I try to use (change), (click) & (select) but still not working.
Please help me…

#2

Tried this one? ionSelect - expression to be evaluated when selected

#3

how to use that? sorry I newbie, I don’t understand

#4

<ion-radio (ionSelect)="radioChecked()"....>
Then in your ts file you define a function radioChecked() that handles click on the radio.

3 Likes
#5

Thank you. This is helpful. How can I get a radio button value passed back to the function, using this? Cheers.

#6
<ion-radio (ionSelect)="radioChecked('YourValue')" ....>

@bpeary
You can send your desired value like this and then you can use it in your .ts file easily!!!

4 Likes
#7

Thanks! That’s helpful information!

1 Like
#8

You are welcome @bpeary :slight_smile:

1 Like
#9

You can pass value just using $event instead of passing hard coded value
<ion-radio (ionSelect)=“radioChecked($event)” …>