![]() |
#1 |
Registered User
Join Date: Jul 2011
Posts: 177
|
ASP multine textbox maxlength
I am using ASP.NET in Visual Studio .NET, I am making a form that contains a comments box. For that I used a multiline textbox. My problem is that I want it to have a maximum of 250 characters but maxlength does not apply to multiline texbox. How can I fix it?
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#2 |
Registered User
Join Date: Feb 2012
Posts: 98
|
Asp.net asp.net Fibroids Treatment
|
![]() |
![]() |
![]() |
#3 |
Registered User
Join Date: Jul 2012
Posts: 111
|
If you want to let the user know if he exceeded the amount of characters as he writes, you could use a java script function attached to key press event. This function would test the length of the input and cancel the character rendering if the max length was reached.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#4 |
Registered User
Join Date: Oct 2012
Posts: 33
|
try this
<asp:TextBox ID="txtValue" runat="server"TextMode="MultiLine" Rows="10"Columns="50"></asp:TextBox> $(document).ready(function(){ var MaxLength = 250; $('#txtValue').keypress(function(e) { if ($(this).val().length >= MaxLength) { e.preventDefault(); } });}); |
![]() |
![]() |
![]() |
#5 |
Registered User
Join Date: Apr 2013
Posts: 58
|
oh thanks.............its working.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
#6 |
Registered User
Join Date: Apr 2013
Posts: 6
|
character limitation
here you can try by giving rows n colums value.
|
![]() |
![]() |
![]() |
#7 |
Registered User
Join Date: Nov 2013
Location: Surat
Posts: 971
|
Asp.net asp.net
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , |
![]() |
![]() |
![]() |
#8 |
Registered User
Join Date: Nov 2013
Posts: 92
|
ya its possible..
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|