Jump to content

Recommended Posts

I have 17 form fields. I use $_post to get the variables. Please let me know how to stop the form being submitted if any form field is left blank. I tried but couldn't solve. Please help me.

 

$name = $_POST["name"];
$email = $_POST["email"];
$ans1 = $_POST["ans1"];
$ans2 = $_POST["ans2"];
$ans3 = $_POST["ans3"];
$ans4 = $_POST["ans4"];
$ans5 = $_POST["ans5"];
$ans6 = $_POST["ans6"];
$ans7 = $_POST["ans7"];
$ans8 = $_POST["ans8"];
$ans9 = $_POST["ans9"];
$ans10 = $_POST["ans10"];
$ans11 = $_POST["ans11"];
$ans12 = $_POST["ans12"];
$ans13 = $_POST["ans13"];
$ans14 = $_POST["ans14"];
$ans15 = $_POST["ans15"];
$ans16 = $_POST["ans16"];

 

These are the variables.

Link to comment
https://forums.phpfreaks.com/topic/203968-reject-empty-form-fields/
Share on other sites

I have 17 form fields. I use $_post to get the variables. Please let me know how to stop the form being submitted it any form field is left black. I tried but couldn't solve. Please help me.

 

$name = $_POST["name"];
$email = $_POST["email"];
$ans1 = $_POST["ans1"];
.......
$ans14 = $_POST["ans14"];
$ans15 = $_POST["ans15"];
$ans16 = $_POST["ans16"];

 

These are the variables.

 

i cannot blame you for your bad english, but

there are 18 filelds mentioned...

 

but that has nothing to do with the problem which is unclear because of the 3 or 4 obvious langage errors on 1 sentence...

@jskywalker

I understand your pain. Thanks for your concern regarding my language. I appreciate your effort in finding the mistakes(regardless of how noticeable they were). But yeah, you should work on your perception part. :) See! Other people could understand it even though it had mistakes. Being smart is not everything. :)

 

@Muffins

I think i tried the same. It dint seem to work.

 

@HavokDelta6

I will try to put that to use. Thanks.

@jskywalker

I understand your pain. Thanks for your concern regarding my language. I appreciate your effort in finding the mistakes(regardless of how noticeable they were). But yeah, you should work on your perception part. :) See! Other people could understand it even though it had mistakes. Being smart is not everything. :)

 

<irony>Yeah, jskywalker you don't have any people skills. You obviously need to work on that.</irony>

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.