Is it possible to push an alert inside another alert?


#1

I’m trying to show an alert if there is a missing value in a previous alert used as a floating modal, but after setting the second alert in the nav with this.nav.present(secondAlert) the first one is lost, but i don’t know if an alert can be pushed in the nav or another way to do it. Here is what i have:

let alert = Alert.create({
			title: 'New Task',
			inputs: [
				{
					name: 'task',
					placeholder: 'Task',
					type: 'string'
				},
				{
					name: 'date',
					placeholder: 'Date',
					type: 'date'
				},
				{
					name: 'place',
					placeholder: 'Place',
					type: 'string'
				}
			],
			buttons: [
				{
					text: 'Cancel',
					role: 'cancel',
					handler: () => {
						console.log('Cancel clicked');						
					}
				},
				{
					text: 'Add',
					handler: data => {
						if(data.task != ''){							
							alert.dismiss();
						}else{
							let alert= Alert.create({
								title: 'Some error',
								buttons: [{
									text: 'Acept',
									handler: () => {
										a.dismiss();
									}
								}]
							});
							// now present the alert on top of all other content
							this.nav.present(a);
						}					
							
						
					}
				}
			]
		});
		this.nav.present(alert);

#2

Alert-inception…

I really don’t suggest doing this. Not only is it confusing UX, it’s also becomes a bit of an issue when trying to coordinate them with navController. I really think you should use a different approach.


#3

Well I’d try to find a work around then…


#4

What about use a form validation instead of the second alert?