[ 
http://issues.apache.org/jira/browse/VALIDATOR-207?page=comments#action_12450229
 ] 
            
Niall Pemberton commented on VALIDATOR-207:
-------------------------------------------

Disabled fields are not submitted by the browser and so are effectively not 
present, which is why this method works this way.

For the "required" validator this means that the validation will fail - which I 
believe is correct, otherwise validation will pass even though whats submitted 
won't contain the "required" value. For the other validators it means that 
disabled fields are not validated.

So your statement "not supposed to validate fields that are set as disabled" is 
true for all the validators except "required". If you need the "required" 
validator to work differently, you can always plug in your own version, but as 
far as I'm concerned this is working as intended and so I'm planning to close 
this as "INVALID".

Niall

> Disabled fields should not be checked by the validateRequired function.  
> Relevant to adding the check for field disabled in jcv_isFieldPresent.
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: VALIDATOR-207
>                 URL: http://issues.apache.org/jira/browse/VALIDATOR-207
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: JavaScript
>    Affects Versions: 1.3.0 Release
>            Reporter: Joseph Breuer
>
> For validateRequired the following condition checks to see if the field is 
> present.  It then sets the validity to false.
>             if (!jcv_isFieldPresent(field)) {
>                 fields[i++] = oRequired[x][1];
>                 isValid=false;
>             }
> Supposedly validateRequired as well as all of the validate methods are not 
> supposed to validate fields that are set as disabled.  This method seems to 
> categorize disabled fields with those that are null or are undefined.
> validateRequired should differentiate between the disabled fields and the not 
> present fields.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to