Re: JavaScript Question

  • From: "Jeff Bishop" <jeff@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 22 Jul 2009 05:05:30 -0700

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



__________ 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: