Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

IONIC 6 Alert controller not working as expected

$
0
0

@rahulsharma841990 wrote:

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?

image

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



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