Jump to content

reject empty form fields


sudeepk

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.