[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Form validation using perl



Aravind Balasubramanian proclaimed:
> I have been doing an application module in Perl. I am able to validate
> each field in the form, only after i finish the full form entry. I would
> 
> like to know a way by which i can validate a field while entering its
> value itself.


I am assuming that you are talking about an HTML form that gets submitted
to be processed by a perl application (cgi script).

perl only kicks in when the form is submitted.  What you need is some kind
of client-side scripting language.  JavaScript is a widely used client-side
scripting language which can do what you are looking to do.  See
http://developer.netscape.com/ for more info om JS.

>       Another problem is suppose i have given only a minimum width
> for entering a field in the screen,but i need to enter values more than
> that (scrolling field). (Eg. Suppose I allot only 20 charactors width to
> be displayed in the screen and i want the field to accept say 30
> charectors)


Read the basic HTML tag reference on form fields.  Something like

<INPUT TYPE=TEXT NAME="foo" SIZE=20 MAXSIZE=30>

will display a field of 20-character width and will let you type in a
maximum of 30 characters (scrolling to accomodate the extra chars).

Thaths
-- 
Homer: [yawns] Marge, I'm bored.
Marge: Why don't you read something?
Homer: Because I'm trying to _reduce_ my boredom.
Sudhakar C13n    http://www.aunet.org/thaths/    Lead Indentured Slave