I’m reading this page trying to figure out how to validate the first input in my form.
My form opening looks like this:
<form action="thankyouBE17W9.php" method="POST" name="myForm" onsubmit="return checkForExpiration();" >
and the textbox is:
<p> <h3> Please insert your student number here: </h3> <INPUT TYPE="Text" NAME="sn" maxlength="10" size="10"> </p>
I’m getting some emails without a student number in the Subject line. They forget to enter their student number.
The student number is 10 digits, like: 1725010555
The name of the input box is “sn”, and they cannot insert more than 10 characters.
I don’t really need to check for empty, I just need a check like:
if len(sn) < 10:
go back and do it again
How do I, a layman, do that in php?
Also, if there is a problem, I think I need something like:
to send them back to the page. Would that work? Or do I need the complete path??
Thanks for any links, tips, advice!