Find jobs - Wordpress Themes - Debt Consolidation - Debt Consolidation - Debt Consolidation

PDA

View Full Version : Form Validation Help Needed Please


chimp
Dec 4th 2006, 11:19 pm
I am knew here so hi to everyone, I have been told by a friend that this site is particularly helpful so here goes.

I have a form that i want to ensure is filled out correctly before the user is able to proceed. I am also advised that Javascript is the easiest way to do this, however i have no idea how to implememnt it.

http://chimp.cc/start.htm

If the user fails to fill out the terms and conditions box with a "Yes"when the user clicks submit, i want a message to pop up to tell them to complete it.

and to return the user to that field for completion.

I honestly have no idea how to do this, can someone please help me.

I have attached the source code too.

Cheers

Andy

krakjoe
Dec 5th 2006, 1:32 am
krakjoe.info/elp/ChimpCode.zip

you need to edit the form action to put it back how it was, and also, do you not want the file to submit the form to sendmail ?

chimp
Dec 5th 2006, 1:41 am
ok cheers, i just downloaded the file and opened it in firefox, tried to click the sumbmit button and the message appeared excactly as i wanted.

However when it refreshes the screen it blanks out all the entered data.

Also

Yes what it is meant to do is populate an email with the fields from the form,

I have no idea what to change within the form to get it too do what i want or what you suggested tho, so any further hep would be great thanks

krakjoe
Dec 5th 2006, 1:51 am
how about I validate the form stuff with php ? and send the mail with php ?

that would be easier for me, and better for you I think ....

chimp
Dec 5th 2006, 1:53 am
seriously i need all the hlp i can get with this so if thats the easiest option then i am more than happy to go with the flow..

Many thanks

krakjoe
Dec 5th 2006, 2:31 am
krakjoe.info/elp/ChimpHelp.phps

Save it as whatever.php where whatever is your filename, I believe that does everything you need it to do :)

@ krakjoe.info/elp/ChimpHelp.php

chimp
Dec 5th 2006, 2:41 am
ok thanks again,

i have the file, i have renamed it start.php uploaded it to my webspace again,

chimp.cc/start.php

all seems ok, lists all the fields that are not populated yet even when i enter "yes" in the box it tells me i must agree to the terms.

I should get the message if it is null or "Yes" is not entered

Any ideas please?

krakjoe
Dec 5th 2006, 2:43 am
krakjoe.info/elp/ChimpHelp.phps

Downlaod again, sry, fixed....

chimp
Dec 5th 2006, 2:47 am
ok i have done that you wanna try it

cos even if i submit the form with all fields populated i still get a message to agree to the terms

chimp.cc/start.php

code now starts like:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
p {text-align: justify; padding: 10px;}
</style>
<?
$sysmail = "myemail@addy";

if ($_POST)
{

krakjoe
Dec 5th 2006, 2:48 am
download the above version and replace the old file, it definately works this time....
krakjoe.info/elp/ChimpHelp.phps

chimp
Dec 5th 2006, 2:59 am
ok i agree that works perfectly thanks,

one last question...

When the user has been promted with the "request submitted etc" and there is a "ok" button which bit do i change to redirect to a different page than the start.php page lets say "chimp.cc/"

cheers

krakjoe
Dec 5th 2006, 3:07 am
krakjoe.info/elp/ChimpHelp.phps

done, download again ....

chimp
Dec 5th 2006, 3:21 am
you are a STAR many many thanks for your help, i really do appreciate it.

Andy

krakjoe
Dec 5th 2006, 3:23 am
always a pleasure :)