Click here to Skip to main content
13,049,814 members (74,427 online)
Rate this:
Please Sign up or sign in to vote.

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 10-Jun-13 8:50am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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...
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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:[^].

First of all, see how the demo works.

There are many variations of this technique and design. Please see also:[^],[^].

Another keyword you can use to find some solutions would be:[^].

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.
The form element has the onsubmit event:
That's what you can use.

Are you accepting the answer formally (green button)?
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 10 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100