Page 1 of 1

Form validation

Posted: Wed Sep 20, 2006 2:01 pm
by gkwhitworth
Ok, at my work my boss is a MS fan, big time and she forces us to use bloody Frontpage. I have a form for a client and have tried using MS extensions and their stupid form properties to validate the text-area to only 300 characters, about 50 words. Only, it doesn't work worth crap. I have tested it several times and it has allowed me to write thousands of characters many times.

I have done simple form validation using the empty() code, but I need something like:

Code: Select all

if (comments == "# of characters") {
echo "sorry please try again";
}
Now remember, the form isn't be sent with PHP so there are no variables to pass or anything. The text-area's name is "bio."

--
Greg

Re: Form validation

Posted: Wed Sep 20, 2006 2:20 pm
by volka
gkwhitworth wrote:Now remember, the form isn't be sent with PHP so there are no variables to pass or anything.
meaning?

Is the form's method post or get?
strlen() returns the length of a string.

Posted: Wed Sep 20, 2006 2:45 pm
by gkwhitworth
Thanks volka I will try that, I got the MS Extensions to work....man do they suck. Unfortionatley they don't want to do the entire form in PHP, maybe next year right?
Is the form's method post or get?
It is using POST, but I didn't want people to think that the form was using PHP, I now realize that that really doesn't matter, but I thought I would cover my bases.

--
Greg

Posted: Wed Sep 20, 2006 2:50 pm
by volka
Then the parameter should be represented by $_POST['bio'] and strlen($_POST['bio']) should return the length of it.