0

FORM - http://hoffwebsites.com/CBENT/registration_form.php

I have a form where a parent registers a student.

There is an option to register another child.

What I need to do is if a parent registers another child, and the input field Student's Full Name is filled in (name twosfn) then Hebrew Name is REQUIRED (name twohn).

Here is my PHP code in my mailing script.

if ($_POST['twosfn']=="TRUE" && $_POST["twohn"] == "") 
{
Print("<style type=\"text/css\">
body { 
font-family: arial;}
input { 
border: 1px solid black; padding: 5px; }
table {font-size: 14px;}</style>
<center><br><br><br><b>Please enter Hebrew Name</b><br><br>
<a href=\"javascript:history.go(-1)\" style=\"color: black;\">< Back</a></center>");
exit();
}
0

You can do this: if (isset($_POST['twosfn']) && !empty($_POST["twohn"]))

4
  • I'm sorry but that does not work. It still lets me submit the form if twosfn has been filled in and twohn has NOT been filled in. – Gina DiSanto Jun 27 '17 at 16:17
  • if (isset($_POST['twosfn']) && !empty($_POST["twohn"])) { Print("<style type=\"text/css\"> body { font-family: arial;} input { border: 1px solid black; padding: 5px; } table {font-size: 14px;}</style> <center><br><br><br><b>Please enter Hebrew Name</b><br><br> <a href=\"javascript:history.go(-1)\" style=\"color: black;\">< Back</a></center>"); exit(); } – Gina DiSanto Jun 27 '17 at 16:22
  • Can you write the HTML elements you want to use? – Elizbar Yousuf Jun 27 '17 at 16:37
  • Sorry, exactly what HTML elements do you mean? Here is my form hoffwebsites.com/CBENT/registration_form.php – Gina DiSanto Jun 27 '17 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.