You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/12/19 19:26:20 UTC

DO NOT REPLY [Bug 37962] New: - maxlength on textarea in firefox the javascript doesn't match serverside

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37962>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37962

           Summary: maxlength on textarea in firefox the javascript doesn't
                    match serverside
           Product: Commons
           Version: 1.4 Final
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: apache.9.alanf@antichef.net


When using firefox with a textarea that has a maxlength, if you include carriage
returns in your data entry, the client side javascript will not match the server
side java. On the client side the javascript is only seeing a \n for the
carriage returns while on the server side the java is seeing a \n\r.  So if you
have a max length of 5, 1\n2\n3 will pass the client side, put fail the server
side since there is will be 1\n\r2\n\r3.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 37962] - [validator] maxlength on textarea in firefox the javascript doesn't match serverside

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37962>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37962


ebourg@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|maxlength on textarea in    |[validator] maxlength on
                   |firefox the javascript      |textarea in firefox the
                   |doesn't match serverside    |javascript doesn't match
                   |                            |serverside




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 37962] - [validator] maxlength on textarea in firefox the javascript doesn't match serverside

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37962>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37962


niallp@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From niallp@apache.org  2006-01-09 08:05 -------
I have modified both the server side and client side validation so that 
the "line ending" length can be specified for the min and max length 
validators. The validators now "adjust" the value's length if a line ending 
length is specified.

http://svn.apache.org/viewcvs?rev=367226&view=rev

So for example, to treat line endings (either "\n" or "\n\r") as a length of 1

  <field property="foo" depends="required,minlength,maxlength">
      <var>
          <var-name>lineEndLength</var-name>
          <var-value>1</var-value>
      </var>
      <var>
          <var-name>minlength</var-name>
          <var-value>5</var-value>
      </var>
      <var>
          <var-name>maxlength</var-name>
          <var-value>20</var-value>
      </var>
  </field>

This will be available in the next nightly build:

  http://cvs.apache.org/builds/jakarta-commons/nightly/commons-validator/

However, if your using this with Struts the Struts FieldChecks class needs to 
be modified for the server side validation in Struts to work with this change. 
Struts will be changed once the next release of Commons Validator has been 
done. I have opened Bug 38191 against Struts in order that it doesn't get 
forgotten.

Closing this as FIXED

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org