commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37134] - [validator] Built-in JavaScript incompatible with modern AJAX techniques
Date Tue, 22 Nov 2005 19:14:49 GMT
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=37134>.
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=37134





------- Additional Comments From p.mouawad@ubik-ingenierie.com  2005-11-22 20:14 -------
Created an attachment (id=17015)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17015&action=view)
Correction to JS files of the library starting from version 1.1.4

Here are the correction made on your Javascript:

Scope too large for your variables:
*	 oCreditCard, oByte,oDate
*	 Replaced == true by === true, same for == 0
*	 parse(x) replaced by parse(x, 10)

I'am using prototype.js in conjunction with the validator but I am facing the
following problem,
this library adds a field extends to objects so for (var x in oRequired) will
iterate over 4 fields instead of 3
and encounter x = 'extends' and oRequired[x][0] will be undefined breaking the
rest.

What I did was to add matchValidationVariable () function with the following
code that checks that the variable
oRequired[x][0]  is not undefined and that the name of x matches your variable
names ('^a[0-9]*$'):
  function matchValidationVariable(variable, value)
  {
		  var theRegexp = new RegExp('^a[0-9]*$');
		  return ((typeof value[0] !== undefined) &&
			  (theRegexp.exec(variable) !== null));
  }

-- 
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


Mime
View raw message