Jump to content

wanting to create a simple form to print with required fields


Recommended Posts

Hello.  I am VERY new to this and I apologize if this has been touched on before but I wasn't able to find what I was looking for in my searches.

 

I am wanting to create a simple webform page where there are a certain amount of fields to fill in and the user will then print the page out.  However, I am trying to figure out how to make it to where it won't let them print it out (and give them a message saying so) if all of the required fields aren't filled out.

 

This seems simple but since I am new, it is very overwhelming :).

 

Any help would be VERY much appreciated!

All you have to do is check if the required fields are empty, like so

 

<?php

if (!isset($_POST['form_field'])){
   echo "You didn't fill out the form field!";
} else {
   //it was filled out
}

?>

 

Here are some tutorials on working with forms

http://www.tizag.com/phpT/forms.php

http://php.about.com/od/learnphp/ss/php_forms.htm

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.