IBM Business Automation Community Come for answers. Stay for best practices. All we’re missing is you. Join / Log in Ask a question
im on bpm 8.5.6 and using mainly IE 9 as browser. I need to set the maxlength attribute of a textArea (i used the one provided in the coaches toolkit and tried fiddling with it) to 1000. However, i cant seem to get it. i tried locating the textArea tag in the html once the view is loaded...#Featured-area-2#Featured-area-2-home
Hi,The maxlength attribute is not supported on IE9. You'll have to implement a solution in javascript. You could try something like:
var textarea = document.querySelector("textarea"); var onPaste = function onPaste(event) { var len = parseInt(this.getAttribute("maxlength"), 10); if (this.value.length + window.clipboardData.getData("Text").length > len) { this.value = this.value.substr(0, len); return false; } } var onTextInput = function onTextInput(event) { return (this.value.length < 10); } textarea.onpaste = onPaste; textarea.onkeypress = onTextInput;
I don't have an IE9 browser to test this on and so I am concerned about accessing the clipboard in the paste function. You may have to change the code a bit.
Hope this helps.