Home All Groups Group Topic Archive Search About
Author
2 May 2005 7:12 PM
TCORDON
How can I restric a multirow textbox's text length, Max Length doesn't seem
to really do anything. I want the user to not be able to type, say more that
300 chars.

TIA!

Author
2 May 2005 9:37 PM
Steve C. Orr [MVP, MCSD]
You'll need to use javascript to accomplish this.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net



Show quoteHide quote
"TCORDON" <tcord***@hotmail.com> wrote in message
news:u2ms3r0TFHA.952@TK2MSFTNGP10.phx.gbl...
> How can I restric a multirow textbox's text length, Max Length doesn't
> seem to really do anything. I want the user to not be able to type, say
> more that 300 chars.
>
> TIA!
>
Author
3 May 2005 12:01 PM
Elan chezhian via DotNetMonster.com
Hi TCORDON

         Here are the steps to restrict the text lenght multirow textbox's
while the user types.

Step 1 : Add the Attribute Property to the multirow textbox Control Id
         If your multirow textbox's Id is "txtAddress"

         Me.txtAddress.Attributes.add("onclick","return CheckLenght();")

         in the Code behind (Means aspx.vb file)

Step 2 : <Script Language=Javascript>

function CheckLenght()
  {
    var strLenght = document.getElementById("txtAddress").value.length;
   return (strLenght <= 300)
}

How can I restric a multirow textbox's text length, Max Length doesn't seem
to really do anything. I want the user to not be able to type, say more
that
300 chars.
Author
3 May 2005 12:05 PM
Chezhian@drivestream.com via DotNetMonster.com
Hi TCORDON

         Here are the steps to restrict the text length multirow textbox
while the user types.

Step 1 : Add the Attribute Property to the multirow textbox Control Id
         If your multirow textbox's Id is "txtAddress"

         Me.txtAddress.Attributes.add("onclick","return CheckLength();")

         in the Code behind (Means aspx.vb file)

Step 2 :
<Script Language=Javascript>

function CheckLength()
  {
    var strLenght = document.getElementById("txtAddress").value.length;
    return (strLenght <= 300)
}

</Script>

Hope this helps ! All the best.