Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 01-11-2009, 12:00 PM   #1
Join Date: Oct 2006
Posts: 74
Default Cannot stop php

The check works but it runs the contact.php which I don't want it to do if js shows a popup window.
function validate()
       if (document.forms[0].Email.value == "")
               alert("User Name is a required field. Please fill in your User Name.");
               return false;
       return true;
<form action="contact.php" method="post" name="Contact" id="Contact" onsubmit="return validate();">
<input name="Email" type="text" class="form_input" id="Email" size="34">
<input name="Submit" type="submit" value="Submit">
Rich_A06 is offline   Reply With Quote
Old 01-12-2009, 12:05 AM   #2
edbr's Avatar
Join Date: Aug 2005
Location: Bali
Posts: 11,203

not my thing javascript but shouldnt
return validate() be just
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is online now   Reply With Quote
Old 01-12-2009, 09:22 AM   #3
Join Date: Oct 2006
Posts: 74

You might be right however, I found this site http://www.freeformmaker.com/ (after spending hours looking for code only to find a simply google for "free form generator" gave me what I wanted!). It works perfectly, I made one preview with all types of form, customised it a bit, then made a template and am very pleased with the result. The auto response didn't work for me, neither the text file generation but the rest all works perfect. It's html/php/css mix, totally styleable.

Last edited by Rich_A06; 01-12-2009 at 09:26 AM..
Rich_A06 is offline   Reply With Quote
Old 01-19-2009, 02:11 PM   #4
davidj's Avatar
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256

onsubmit="return validate()"
should be

Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:53 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com