fix numbervalidation for decimal comma locales on IE7/IE8

If you think that something doesn't work in Aware IM post your message here
Post Reply
bmeyns
Posts: 61
Joined: Tue Oct 19, 2010 1:40 pm
Location: Belgium
Contact:

fix numbervalidation for decimal comma locales on IE7/IE8

Post by bmeyns »

There is an bug in the aware.js script for Internet Explorer 7 / 8 (Aware v. 5.9 b1908)

When you are using a locale with a comma as decimal mark symbol (most European countries), a specific function names "replaceDecimalComma" is used to prepare numeric values for database input.
e.g. €9,53 should be stored as 9.53 in the database.

On Internet Explorer (7 / 8) this function returns "undefined" and invalidates the data.

This can be fixed by using replacing the array iteration v by the v.charAt(i) function:

Code: Select all

for (var i = 0; i < v.length; ++ i)
{
	if (v.charAt(i) == Ext.util.Format.decimalSeparator)
		s += ".";
	else if (v.charAt(i) == Ext.util.Format.thousandSeparator)
		s += ",";
	else
		s += v.charAt(i);
}
cfr. aware_full.js (Aware v. 5.9 build 1908: ca. line 3594, look for function "replaceDecimalComma)

rename "aware_full.js" to "aware.js" (or fix the compressed "aware.js")

More info about using string brackets can you find here http://blog.vjeux.com/2009/javascript/d ... rings.html
Benny (running v.5.9 - build 1908 on Linux)
LinkedIn: http://www.linkedin.com/in/bmeyns
Post Reply