[thelist] javascript in perl??

Adrian Fischer adrian at logo-logic.com
Fri Mar 30 19:40:52 CST 2001


Hi Gang,

I am trying to embed a javascript form checker into a perl/cgi script.  The
form and js work when testing as a straight .html page but as soon as I ad
some print <<"EOF"; and EOF at the end of it, and give it a  .lib extension
it doesnt work.  Am I missing something fundamental here?

I have tried putting the js in head of the document and within the body.  It
works either way as a html doc but makes no difference as a perl thing.

Here is the html version:
http://aussiebidder.com/cgi-bin/dockets/untitled3.html
and here it is within the perl script:
http://aussiebidder.com/cgi-bin/dockets.pl?emailads

If you look at the perl one you will see that when you click preview that it
runs a form checker within perl.  This is what Im trying to avoid by doing
it client side (its quicker).

And I was so pleased with myself for thinking I had this validator worked
out...

Any and all assistance woild be appreciated.

Oh..heres a tip...I asked the other day about limiting the input into a
textarea field..this is what I found (thanks also to those that offered
advice)

<tip type="formatting textarea">
<SCRIPT LANGUAGE="JavaScript">
function checkTextarea()
{
var max=10;
if (document.form.yourtextarea.value.length > max)
{alert("You got to many characters in here!");}
}
</script>
<FORM name=form onsubmit="return checkTextarea()" ACTION=blah METHOD =blah>
<textarea name="yourtextarea" rows="3" cols="30" ></textarea>
<input type="submit" value="Submit">
</FORM>
</tip>







More information about the thelist mailing list