Trigger sweetalert box after successfully submit form

Issues related to forms.
Post Reply
johnmalay
 
 
Posts: 21
Joined: Sun Sep 18, 2016 11:29 am

Trigger sweetalert box after successfully submit form

Post by johnmalay » Thu Aug 30, 2018 5:12 am

how to call sweetalert javascript after submit the form value into server database. now i'm using success.php page for it, i try to change to sweetalert box.
this is sweetalert link https://sweetalert.js.org/ a beautiful popup message replacing old style javascript message. i'm able to validate input type, but i'm stuck with the form processing.

some help from programmer, but i'm stuck with this code

Code: Select all

//this code will trigger if value inside POST 's' 
if(isset($_POST['s'])){
	if($_POST['s'] == t){
		   //trigger sweetalert for success
		}
		
		else{
		 //trigger sweetalert for failure
		}
}

User avatar
Pablo
 
Posts: 14502
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Trigger sweetalert box after successfully submit form

Post by Pablo » Thu Aug 30, 2018 6:14 am

You cannot call a JavaScript from PHP code.
JavaScript is executed by the browser, PHP code is executed on the server.

johnmalay
 
 
Posts: 21
Joined: Sun Sep 18, 2016 11:29 am

Re: Trigger sweetalert box after successfully submit form

Post by johnmalay » Thu Aug 30, 2018 6:57 am

do you have guide how to call after success ?

User avatar
Pablo
 
Posts: 14502
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Trigger sweetalert box after successfully submit form

Post by Pablo » Thu Aug 30, 2018 11:00 am

I'm sorry, I do not have any experience with this myself. For me, it may also take several hours or days to figure out how to do this.
This is not directly related to WWB.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests