Side panel - form sent - how display success message?

2 replies · opened Aug 22, 2019

RrdetwilerAug 22, 2019

Hi Canvas,

I'm using the right side panel. Instead of the quick contact form, I've put several checkboxes. When the form is submitted I was surprised that the "processor" script is executed (I thought the processor script would load in a new window.) I'm happy that it functions this way, however, I'm unable to figure out to display a "success" message. When the form Button is clicked, the form box greys out. Again, the data is actually sent to the DB and everything on the backend works. How, though, can I add a "Success" message so the user sees that the data was successfully received?

In the code below, the form submit button loads a processor file. When the form button is clicked, that processor file runs and the checkbox data is successfully uploaded to the DB. My processor file has a success message. You know, something like, if data is uploaded to DB, then $success = "message";

Is there a css class or some js that I need to put around that message?

I've attached two screenshots so you can see what the panel looks like before and after the "ADD" button is clicked.
Thank you in advance for your quick reply and please let me know if I can provide more detail. Thank you.

Here is the code:


	
		[](#)
	

Add to Class

	
		
		
		
		
			
		
			
				
- 
			
		
			

		
	
 

	This quiz will be added to the checked classes.
	
	
			
	
		
		
">
">
">

		
			">
				
				Class 1 - Class Code: 
				
		

		

		
			">
				
				Class 2 - Class Code: 
				
		

		

		
			">
			
			Class 3 - Class Code: 
			
		

		

		
			">
			
			Class 4 - Class Code: 
			
		

		

		
			">
			
			Class 5 - Class Code: 
			
		

		

	
		

	

	
 
 
 

	
	 ..............
SSemicolon WebSTAFFAug 22, 2019

Hello,

Simply make sure that the PHP File returns the following JSON String on Successful Execution:

echo '{ "alert": "success", "message": "Success Message!" }';

That's all! This will definitely work fine. Hope this Helps!

Also, make sure that every message (error or success) you return from the PHP File, is in the above format.

Let us know if we can help you with anything else or if you find any further issues.

RrdetwilerAug 24, 2019

Thank you very much for the quick reply. This worked beautifully.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard