This is a migrated thread and some comments may be shown as answers.

Can i warn user when max chars limit is reached?

1 Answer 189 Views
Input
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 10 May 2012, 10:51 PM
I have some radtextboxes on my website with maximum character limits such as 50 chars, because this is the size of the database field that the control is saved to. Now it has happened that users have tried to enter more text but the ui won't let them. So they phone up and complain that the website is broken. Is there a way to fire an event if they try to type more chars than the field allows? Then i could pop up an explanatory warning message to tell them that 50 chars is the limit. I don't want to clutter the ui with on-screen labels saying "this box accepts 50 chars max" when 99% of people will never exceed this limit. Any suggestions? Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 May 2012, 08:27 AM
Hello John,

Try the following javascript to achieve your scenario.
JS:
function OnValueChanged(sender, args) {
if(sender.get_textBoxValue().length==50)
 {
   alert("50 characters is the limit");
 }
}

Thanks,
Princy.
Tags
Input
Asked by
John
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or