Sorry about this...

Results 1 to 2 of 2

Thread: Sorry about this...

  1. #1
    Join Date
    Dec 1969

    Default Sorry about this...

    This isn&#039t really a question about ASP, it&#039s somewhat related, but I figured I&#039d ask, because everyone here seems to have the answer to everything.<BR><BR>Question: How can I limit the number of characters allowed to be entered in a &#060;textarea&#062;? I know for a "type" field, that all you do is specify maxlength="x". I tried that with the textarea tag, and it was a no go. Anyone have an answer for this?<BR><BR>Thanks<BR>Steve<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Try and JS FAQ, but...

    ...I think I remember reading that there isn&#039t any way.<BR><BR>Well, you *can* take control of the keyboard input when the user is focussed in that field and count characters that way. But then you have to "resync" all the time in case the user did delete or cut/paste with the mouse.<BR><BR>Maybe the easiest thing to do is to wait for the onBlur event from the TextArea and then go count characters. Put up an alert or confirm to warn user the text will be chopped if he/she doesn&#039t do it before the page is submitted?<BR><BR>Anyway, do check out the JS FAQ on that site. They might have something on the subject. (And if not, it&#039s a good place to ask the question.)<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts