PDA

View Full Version : submit button on form


urbanrays
02-10-2009, 01:43 PM
Hi All

Its very quiet on here today so I'll create a post.

I have a email form and the submit button has 2 actions first is to validate the form and the second is to pop up a thank you message "using pop up" in behaviours, the trouble is that if the form is not filled out completely the form will pop the message telling the user which fields are required and then instantly pops the thank you message up too.

What I need to happen is for the thank you message to pop up once the form has been fully validated.

If you need to have a look what I mean the site is www.urbanrays.co.uk/commercial.htm (http://www.urbanrays.co.uk/commercial.htm)

Thanks for your help

domedia
02-10-2009, 02:18 PM
That's just the HTML page. The form processing is in commercial.php.

You should just remove the javascript pop-up for thank you message.
Have commercial.php redirect to a separate thankyou page if the form was successfully sent.

urbanrays
02-10-2009, 03:01 PM
This may sound like I am being a fussy a##e, but i wanted just a small pop up thank you message and redirect back to home page.
By the looks of things I have 2 options either have the form validation and loose the pop up or vice versa.
Thanks for your help

domedia
02-10-2009, 03:42 PM
no you can still have the pop-up, but you have to call it after the form has been successfully sent. :)

urbanrays
02-10-2009, 04:15 PM
Oooo didnt realise this, The problem I am having is that I dont touch php with a barge pole and the software I use just generates the php the only thing it requests is the email address, thankyou.htm and the error.htm, the code the software produces that is placed on the form is this

<input type="hidden" name="hdwemail" id="hdwemail" value="emailaddress" />
<input type="hidden" name="hdwok" id="hdwok" value="thanks.htm" />
<input type="hidden" name="hdwnook" id="hdwnook" value="error.htm" />

How do I create a pop up from here

Thanks for your help

domedia
02-10-2009, 06:56 PM
No idea, you need to edit your PHP file. If it's a canned solution, you're stuck with it.

Ricky55
02-10-2009, 06:59 PM
just got your PM Urbanrays, are you all sorted now? I didn't quite get what you meant.

Does this work how you want if so I'll send you the script.

http://www.dentvanishltd.co.uk/contact.html

urbanrays
02-10-2009, 07:41 PM
Hi yeah that works,
Thanks for that mate if you could post us the script for that I will try and get it to work in my tabbed pages,id prefer to tackle the CSS than take a crash course in zargonian and learn that alien language PHP

Thanks again mate