Hi
Does TextBoxProvider with TextMoe="Multiline" support maxlength property.
Eventhough i set the maxlength property it is accepting more than the max length
Am i doing anything wrong or maxlength property is ignored when the the Text mode is set to Multiline
Regards
Jojesh
Hello Jojesh,
About the TextBoxProvider MaxLength property, if the TextMode is SingleLine, then you can set the MaxLength to be 5 for example, and this will limit the input to be only 5 characters. MaxLength has no affect when TextMode is Multiline.
To limit the number of characters on a multiline editor then you would need to use BLOCKED SCRIPT
First of all, give a Static id to the editor provider:
If you have any other question, do not hesitate to contact me!
Hi Zdravko
I was trying the solution that you provided me to implement maxlength checking.
I did the same thing but i got e = undefined. What could be wrong?
The version am using is 2013 v1 SR
What i did is given below
var DTL_COMMENT_MAX_LENGTH=100;
function onGridInitilized(sender, eventArgs){
var editor = document.getElementById("DTL_COMMENT_EDITOR");
editor.onkeydown = function(e) {
if(e.keyCode == 8 || e.keyCode == 46)
return true;
if(editor.value.length >= DTL_COMMENT_MAX_LENGTH)
return false;
}
<EditorProviders>
<ig:TextBoxProvider ID="DTL_COMMENT_TEXT_PROVIDER">
<EditorControl ID="DTL_COMMENT_EDITOR" ClientIDMode="Static" TextMode="MultiLine" MaxLenght="100"/>
</ig:TextBoxProvider>
</EditorProviders>
Please note this is not exact copy paste of my code. Because we are not allowed to access internet on developing PCs.
Hi jojesh,
I'm just following up to see if you need any further assistance with this issue. Have you been able to resolve it?
When you have time and try that I recommend you, just let me know about the result. Don't hesitate to ask me if you have additional questions. Looking forward to hearing from you!
DEar Zdravko
Thanks for your support.
I managed implemented the same logic which i was using it before. While updating use substring. I am running out of time. So just thought of doing it in known way. One i finish it then try to do investigate.
Hi Jojesh,
Can you tell me which browser (and version) you use? When issues like this show up, it's best to use any kind of a JavaScript framework. Browsers have different ways of handling keyboard events. Have a look at this reference:
http://unixpapa.com/js/key.html
Those frameworks are build to avoid issues with different browsers. Use jQuery to find the EditorControl and use .keydown event.
Html head:
In the JS tag:
Try this and let me know if you have any problems related to this issue