You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/05/03 21:10:45 UTC
DO NOT REPLY [Bug 34730] New: -
Javascript Validation Functions
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=34730>.
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=34730
Summary: Javascript Validation Functions
Product: Struts
Version: 1.2.4
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P3
Component: Validator Framework
AssignedTo: dev@struts.apache.org
ReportedBy: rlv@bravepoint.com
All the Javascript validation functions, like validateRequired, do not check to
see if the field that is being validated actually exists on the form. In other
words, they do not do a null check. I know you may be thinking that if the
field is null, then there should be no validation done on that field. However,
I have many pages that have one or more fields that may or may not be rendered
on the page based on whom is logged in. If they are rendered, then they must be
validated; if not, then they obviously do not need to be validated. So
basically, I had to change the javascript functions to ignore fields that are
null so they will be validated if they exist and ignored if they do not. The
current code throws a javascript error if they field does not exist. This seems
like a bug to me. Basically, all I do is the following in the looping of the
validated fields, after the field is declared:
if (field == null) {
continue;
}
--
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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org