Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 10-Jun-13 9:50am
namo77470
Rate this: bad
good
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...
  Permalink  
Rate this: bad
good
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: 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
  Permalink  
v4
Comments
namo77 at 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 at 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 at 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
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 10 Jun 2013
Copyright © CodeProject, 1999-2014
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