Hi,

when passing a negative value to the numericfield form element, the value is rendered as 0.00 in the input box.

It seems a js issue, I do not know if browser related (I had it on IE7).

Checked the js code and changed in Drupal.parseNumber

var is_negative = (number[0] == '-');

to

var is_negative = (number.substr(0,1) == '-');

This way it works for me. Do you need a patch?

Comments

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

We could do the following instead:

-  var is_negative = (number[0] == '-');
+  var is_negative = (number.charAt(0) == '-');

But that is longer that just accessing the string as an array-like type, and I do not like the idea to fix code because of buggy or incomplete browser implementations.

How many time will IE7 live?

- http://www.w3schools.com/browsers/browsers_explorer.asp

If it works as it is in IE8, then I would live it as-is.

mondrake’s picture

Title: 'numericfield' form element not working with negative numbers » 'numericfield' form element not working with negative numbers on IE7
Status: Postponed (maintainer needs more info) » Active

Changed issue title to reflect it is only IE7 related. No issue in IE8 and FF10.

@markus_petrux - I can live with it as it is. I would suggest though to mention somewhere in the readme and/or project page that minumum IE version is 8, so that appropriate meazures can be taken: the bug itself is quite 'nasty' from an user point of view.

Thanks

markus_petrux’s picture

Do the change in #1 works in IE7?

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)
mondrake’s picture

Status: Postponed (maintainer needs more info) » Active

Yes, #1 works fine in IE7. Thank you.

torotil’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I think it’s a bit too late to add IE7 support now. ;-)