Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Need help to force information

in form......

11:58 am on Sep 17, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 23, 2003
votes: 0

I need to have the following form force information to be added. NO BLANK FORMS. I want all forms to containg data and if they do not I want a pop up to open with the fields that do need to have the data filled. All the tutorials I have seen do not really help me.

Below is some of the code:

$to = "email@email.ca";
$from = "From: email@email.com\t";
$content = "Business Name: " . $_POST["business-name"] . "\r\n \r\n";
$content .= "Their Name: " . $_POST["your-name"] . "\r\n \r\n";
$content .= "Sign Address: " . $_POST["sign-address"] . "\r\n \r\n";
$content .= "Phone Number: " . $_POST["phone-number"] . "\r\n \r\n";
$content .= "Fax Number: " . $_POST["fax-number"] . "\r\n \r\n";
$content .= "Current Message: " . $_POST["current-message"] . "\r\n \r\n";
$content .= "New Message: " . $_POST["new-message"] . "\r\n \r\n";
mail($to, "Website form submission", $content);

Thanks in advance for any help you may provide.

Does the .js go in this pages code?

11:26 pm on Sept 17, 2004 (gmt 0)


WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
votes: 0

if you wanted to do it with javascript then the code would go in the <head> section of the form page.

Since you are using php, why not just check all the vars in that code you posted and if there are errors display the form again with a list of fields to be filled out.