tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22958] New: - NumberValidator forces to input a value when you set maximum and/or minimum but required is false
Date Sat, 06 Sep 2003 17:22:44 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22958>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22958

NumberValidator forces to input a value when you set maximum and/or minimum but required is
false

           Summary: NumberValidator forces to input a value when you set
                    maximum and/or minimum but required is false
           Product: Tapestry
           Version: 3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Framework
        AssignedTo: tapestry-dev@jakarta.apache.org
        ReportedBy: juceri@ya.com


If you use a ValidField with a NumberValidator with, for instance, maximum=10,
minimun=5 and required=false, then generated JavaScript is like the following:

  function validate_FIELD()
  {
    var field = document.Form0.FIELD; 
    var value = field.value;  

    if (value < 5)
      return validator_invalid_field(field, "FIELD must be between 5 and 10.");

    if (value > 10)
      return validator_invalid_field(field, "FIELD must be between 5 and 10.");

    return true;
  }

It forces you to input a value even when required is false.

A patch for this is included in the patch for bug 22838 (NumberValidator.java
and NumberValidator.script). It also add client side validation for
differentiating between decimal numbers and integer numbers.

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


Mime
View raw message