Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.8.2-EE-GA_P01, 1.8.3
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Icefaces rev.20220
-
Workaround Exists:Yes
Description
If user define maxlength then script Ice.txtAreaMaxLen is fired on some events, like below:
<TEXTAREA onmousedown="this.focus();" onkeydown="Ice.txtAreaMaxLen(this,140);" onblur="iceSubmitPartial(form, this, event);" onchange="Ice.txtAreaMaxLen(this,140);" (...)></TEXTAREA>
But the same script cannot be fired onkeydown and onchange. Event onkeydown should return false if new char exceeds range
This patch should helps
<TEXTAREA onmousedown="this.focus();" onkeydown="return Ice.txtAreaMaxLen(this,140);" onblur="iceSubmitPartial(form, this, event);" onchange="Ice.txtAreaMaxLen(this,140);" (...)></TEXTAREA>
Ice.txtAreaMaxLen = function(field, maxlength) {
if (maxlength >= 0) {
if(field.value.length == maxlength)
return false;
if(field.value.length > maxlength)
field.value = field.value.substring(0, maxlength);
}
return true;
}
<TEXTAREA onmousedown="this.focus();" onkeydown="Ice.txtAreaMaxLen(this,140);" onblur="iceSubmitPartial(form, this, event);" onchange="Ice.txtAreaMaxLen(this,140);" (...)></TEXTAREA>
But the same script cannot be fired onkeydown and onchange. Event onkeydown should return false if new char exceeds range
This patch should helps
<TEXTAREA onmousedown="this.focus();" onkeydown="return Ice.txtAreaMaxLen(this,140);" onblur="iceSubmitPartial(form, this, event);" onchange="Ice.txtAreaMaxLen(this,140);" (...)></TEXTAREA>
Ice.txtAreaMaxLen = function(field, maxlength) {
if (maxlength >= 0) {
if(field.value.length == maxlength)
return false;
if(field.value.length > maxlength)
field.value = field.value.substring(0, maxlength);
}
return true;
}
Issue Links
- depends on
-
ICE-3458 Add maxlength attribute to inputTextarea
- Closed
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Krashan Brahmanjara
created issue -
Krashan Brahmanjara
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | textarea.zip [ 12214 ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Component/s | Components [ 10012 ] | |
Fix Version/s | 1.8.2-EE-GA_P01 [ 10220 ] | |
Fix Version/s | 1.8.3 [ 10211 ] | |
Assignee | Mark Collette [ mark.collette ] |
Mark Collette
made changes -
Mark Collette
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Won't Fix [ 2 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee | Mark Collette [ mark.collette ] |