[thelist] Access text box sizing question

Matthew Fischer mfischer at e-fishsolutions.com
Fri Nov 17 15:24:16 CST 2000


This will give the user an alert if they type a 161st character, then chop it off (if they have javascript enabled, obviously):


<SCRIPT LANGUAGE="JavaScript">
<!--

function tooLong() {

    if (document.myForm.test.value.length > 160) {
    alert('Please limit your input in this field to 160 characters.');
    document.myForm.test.value = document.myForm.test.value.substring(0,160);
    }
    
}

//-->
</SCRIPT>

<form name="myForm">
<textarea name="test" cols="40" rows="4" onKeyUp="tooLong()">
</textarea>
</form>

On 11/17/00 at 12:35 PM, prowak at yahoo.com (David Prowak) wrote:

> Hi,
> I have a data entry form that includes a text box
> that I want to use for a field that has a size of 160
> chars (max).  I have set the width of the text box to
> hold 40 chars.  Also, I have created the text box to
> be 4 lines "tall".  But, if while entering data into
> the text box, I continue to hit enter after the 4th
> line, the text box keep scrolling onto the next line.
> 
> How do enforce the text box to adhere to containing a
> maximum of 4 40 character lines?
--

Matt Fischer || e-fish solutions, inc      (e)   \\\\\__   o  
   <mfischer at e-fishsolutions.com>           (e) /    o  \ o
  <http://www.e-fishsolutions.com>           (e)    ((  <
    877.WEB.FISH || 203.272.2987            (e) \+_+_+_/
           Fax 800.203.5816                (e)     \|/





More information about the thelist mailing list