Re: JavaScript Question

I don't know what language it was in, but I have seen fill in boxes on websites 
with limits, and that though they didn't say when I went over, did give me a 
running total of how many characters I had left that I could put in the box, if 
you could find one of those it might give hints to folks. 

HTH,
inthane
proprietor, The Grab Bag, 
for blind computer users and programmers
http://grabbag.alacorncomputer.com
Owner: Alacorn Computer Enterprises
"own the might and majesty of a Alacorn!"
www.alacorncomputer.com
Owner: Agemtree
"merchants in fine facetted and cabochon gemstones"
www.agemtree.com
  ----- Original Message ----- 
  From: RicksPlace 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Wednesday, July 22, 2009 5:16 AM
  Subject: Re: JavaScript Question


  Hi Jeff: That will set the box size but I think it will not limit the 
characters you can enter in the box. This is a multi-line text area. You can 
set the size in rows anc columns but you can type any number of characters into 
the display area, at least that is the way I think it works. There is a 
MaxLength property, again I think that is what it is called, but that only 
works for single line and password TextBoxes. It can be checked server side in 
the code behind file but that doesn't tell the user that they have exceeded the 
number of allowed characters while they are typing. I was thinking of a hot key 
that, when pressed, would tell the user the max characters allowed and how many 
they have used or how many they have left. I have never seen anything like that 
so I was guessing others had solved the problem in some other way.
  By the way, if you think I am wrong about the Rows and Columns or the Input 
element size limiting how many characters can be entered let me know and I will 
check it out but I remember typing more characters in a box than the displayed 
box size would allow but that was a year or so ago so my memory might be faulty.
  Rick USA
    ----- Original Message ----- 
    From: Jeff Bishop 
    To: programmingblind@xxxxxxxxxxxxx 
    Sent: Wednesday, July 22, 2009 8:05 AM
    Subject: Re: JavaScript Question


    I know you want to do it with JAVAScript, but there are simpler ways:

    1.  Use rows and cols for the size.  Set rolws equal to 1 and cols to 10.

    2.  Use a Input tag with a size attribute of 10.

    See if that will work for you Rick.

      ----- Original Message ----- 
      From: RicksPlace 
      To: programmingblind@xxxxxxxxxxxxx 
      Sent: Wednesday, July 22, 2009 5:00 AM
      Subject: JavaScript Question


      Hi: I have the following code to check the TextArea to make sure a user 
doesn't enter more than 10 characters. It works but badly with a screen reader. 
If I enter 11 characters it will keep typing but no more characters are added 
to the box. Then when I try to open it again I just hear a ping with left and 
right cursor. Up and Down cursor reads the 10 characters but I can't delete 
anything using the delete key, I am locked out of the box.
      How do you JS folks handle a MaxLength situation that works well with 
screen readers? Here is the code I am currently using.It took  some work to get 
it working but I am not happy with the way it reads for screen reader users. 
        Overview:
      <textarea name="ctl00$MainStarTrekContent$FormView1$OverviewTextBox" 
rows="10" cols="20" id="ctl00_MainStarTrekContent_FormView1_OverviewTextBox" 
onkeydown="if(this.value.length>=10) return false;" 
onkeyup="if(this.value.length>=10) return false;" 
style="width:800px;">abc</textarea>
        <br />
      Note: These are bound TextBoxes inside a MS ASP.net FormView if that 
colors your solution.
      Thanks for any Ideas:
      Rick USA


      __________ Information from ESET Smart Security, version of virus 
signature database 4266 (20090722) __________

      The message was checked by ESET Smart Security.

      http://www.eset.com

Other related posts: