Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
Hello,

I need to develop a contact form that will bring up a pop-up message saying "Thank you, we'll get back to you soon" when the form is submitted.

How do i do this with php?

I'm done with the html and php, all that remains is the pop-up thank you message. I don't know what to do or how to go about this.

I kindly need some assistance.

Thank you.
Posted

This may sound like a silly question, but do you really need a pop-up?
Why not just direct to a "Thank you" page - it's more in keeping with "normal" website behaviors, and a lot less intrusive to the user.

The problem is that when you bring up a pop-up, the user has to click on it before they can do anything else - which is a PITA most of the time. It is really necessary that the user acknowledge that you thanked them?

Use a page instead - it doesn't "block" the browser from continuing with other things...
 
Share this answer
 
Pop-up windows are easy but generally bad. Many users could use some browsers features/plug-ins to block pop-ups; and they do it for a good reason, due to abuse of pop-ups by advertisers. Besides, as creation of a new browser windows touches some browser-specific features (the choice between a tab and a separate top-level window is one of them), you would have somewhat limited control.

I would rather advise jQuery dialog, which only mimics the behavior of a pop-up dialog on a single page, but does not actually create any popups: http://jqueryui.com/dialog/[^].

First of all, see how the demo works.

There are many variations of this technique and design. Please see also:

http://www.jacklmoore.com/notes/jquery-modal-tutorial/[^],
http://dinbror.dk/bpopup/[^].

Another keyword you can use to find some solutions would be: http://bit.ly/1bp65J8[^].

—SA
 
Share this answer
 
v4
Comments
namo77 11-Jun-13 5:27am    
Wow! Thank you very much.

This is actually what i'm looking for. Thank you so much.

Do you know how I can wrap it to a form submission.

I want the modal to pop up once the submit button is clicked.

Can you tell me how?

Thank you.
Sergey Alexandrovich Kryukov 11-Jun-13 6:51am    
The form element has the onsubmit event:
http://www.w3schools.com/jsref/event_form_onsubmit.asp
That's what you can use.

Are you accepting the answer formally (green button)?
—SA
namo77 11-Jun-13 6:56am    
Wow!!! Thank you so much! You're the best.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900