I used ionic AlertController
to show the prompt with two radio buttons and one text input and here is my code:
const alert = await this.alertController.create({
header: 'Prompt!',
inputs: [
{
name: 'discount_type',
type: 'radio',
label: 'Percent',
value: 'percent',
checked: true
},
{
name: 'discount_type',
type: 'radio',
label: 'Price',
value: 'price'
},
{
name: 'value',
id: 'text',
type: 'text',
label: 'amount',
placeholder: 'Placeholder 3'
},
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirm Cancel');
}
}, {
text: 'Ok',
handler: () => {
console.log('Confirm Ok');
}
}
]
});
but it’s showing three radio buttons, can anyone tell me what’s wrong with my code?