Our forms (here at work) utilize javascript for limiting text. I don't think there
is a perl way to do this.
despite my reservations, I am gonna post non-perl code (at least it's generated by perl).
this is a js routine that will handle it...
function checkTextAreaLen( fName, theField, maxLen )
{
if ( theField.value.length > maxLen )
return msgErrorMid( fName, theField, maxLen, "Please enter less th
+an ", " characters into the \"", "\" field. \nCurrently there are "
+ + theField.value.length + " characters in the field." );
return true;
}
## and here is the onChange that invokes it from a textarea, limiting
+ to 1500 chars
onChange="checkTextAreaLen(gsJobdesc,this,1500)
now I have to find a way to purge away the sin I have committed...suggestions are welcome
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.