We help IT Professionals succeed at work.

Change a button after e-mail

breeze351
breeze351 asked
on
130 Views
Last Modified: 2017-04-06
I have a page with a button that sends an e-mail with the data on the page.  The page that sends the e-mail just returns to the original page.  How do I alert the user that they sent the e-mail (grey out or something else).  Should I set a $_SESSION var?
Comment
Watch Question

Most Valuable Expert 2011
Author of the Year 2014
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Got it. Thought that there might be an easier way.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
In my view AJAX is the easiest option - your backend script only needs logic for sending mail and returning status - no need for rendering an interface. The client script is also very easy - a single AJAX call with a status check in the callback.