Hi,
Thanks for looking.
I have a contact form and everything else is checked against validation apart from the textarea. For some reason i cannot get textarea validation to work using php.
I have tried:
if (strlen($_POST['query'] == 0 ) ) {
echo "<p>You have not entered anything in the text box provided. A minimum of 15 characters is required.</p>";
}
also tried it with < 15 and
if (empty($_POST['query'] ) ) {
echo "<p>You have not entered anything in the text box provided. A minimum of 15 characters is required.</p>";
}
No matter how i try it won't validate or give the above message. Basically meaning users can submit without the need of entering anything in the textarea.
If i put this:
if ($_POST['query'] < 15 ) {
echo "<p>You have not entered anything in the text box provided. A minimum of 15 characters is required.</p>";
}
Problem i have then is it will display the error and won't submit form which is great , but even thou i type over 15 characters it gives me the error still and wont submit.
I am now at the end of my teather. I don't know why and is there another way to validate a text area?
I am boggeled by this.
Any help much appreciated as always.
Thank you,
Genieuk