Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Spell check extending words past textbox/area max size

SA-32710

Summary



In Chrome browser, spell check does not extend the size of a textarea or box when correcting misspelled words.

However, in Internet Explorer, which is used, spell check will extend the number of characters in a textarea or box passed the maximum when correcting misspelled words.


Error Messages



Not Applicable


Steps to Reproduce

  1. Put a maximum size on a textarea/box and then misspell some stuff up to the max.
  2. Right-click on the red squiggly underline misspelled words and fix them.


Root Cause



This behavior difference between browsers is expected.

Resolution



Perform the following local-change:

Use the following function in the userworkform and executing it via runscript onchange/focus of the textarea to make sure that the number of characters does not exceed the maxlength even if it is accidentally set via spell-check:
<script>
window.trimTextArea = function(event){
var target = event.target;
var len = parseInt(target.getAttribute("maxlength"), 10);

if(target.value.length > len) {
//alert('Maximum length exceeded: ' + len);
target.value = target.value.substr(0, len);
return false;
}
}
</script>

Published February 8, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us