Truncate maxlength= fields (#189)
This commit is contained in:
@@ -411,6 +411,11 @@
|
|||||||
el.dispatchEvent(new Event(eventName, { bubbles: true }));
|
el.dispatchEvent(new Event(eventName, { bubbles: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// truncate the value if required by the field
|
||||||
|
if (el.maxLength > 0) {
|
||||||
|
value = value.substr(0, el.maxLength);
|
||||||
|
}
|
||||||
|
|
||||||
// Set the field value
|
// Set the field value
|
||||||
let initialValue = el.value || el.getAttribute("value");
|
let initialValue = el.value || el.getAttribute("value");
|
||||||
el.setAttribute("value", value);
|
el.setAttribute("value", value);
|
||||||
|
Reference in New Issue
Block a user