CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
making a minimum number of characters in a field

 



Killian
Deleted

May 1, 2001, 11:32 PM

Post #1 of 3 (396 views)
making a minimum number of characters in a field Can't Post

how do you make a script do one thing if there are x many characters or less in a form field and do something else if there are more than that many?

This is most likly obvious and I think i know how to do it, but when i tried it didn't work, probably some typo, or i just plumb dont know...



Jean
User


May 2, 2001, 5:12 AM

Post #2 of 3 (392 views)
Re: making a minimum number of characters in a field [In reply to] Can't Post

I'm not familiar with CGI at all, but after the submit button is pressed, you can use the following construct:

Code
if ( length($field) > $minlength ) { 
print "Ok. \n";
}
else {
print "Minimal requirement not met. \n";
}

Jean Spector
QA Engineer @ Extent Technologies, Ltd.
mage@lycosmail.com


Jasmine
Administrator / Moderator

May 2, 2001, 3:15 PM

Post #3 of 3 (381 views)
Re: making a minimum number of characters in a field [In reply to] Can't Post

You may also want to take a look at a previous thread: character count in a form


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives