Hi All,
I have a form that when the user tries to submit the form it runs function onSubmitForm..
it checks to make sure required fields are not blank or like email field is valid email address..etc
with one of my fields i used example like below for text field to make sure no more than 9 characters can be entered and it works fine....
But I have a textarea field (Comments) that is limited to 300 chars (sql table)....so if i go over that i get a sql error when the form is submitted...well, i thought maybe if i set the .length to >=301 thenCode:formDOMObj.PartNo.value.length >='10' alert("Enter 9 digits or less!"); formDOMObj.PartNo.focus(); return false;
it may work like example above but it didn't work (no alert and just sql error)....maybe because its textarea?
I found this nice example even though I would be happy with just an alert saying You've put it more than 300 characters,
please revise.....should this be the way to go?
Javascript Dynamic Text Area Counter
Suggestions?



LinkBack URL
About LinkBacks
....it kept bypassing the alert and just kept getting the ugly sql error.... 

Bookmarks