Reply
problem with regular expressions in Firefox
Old 08-06-2005, 10:18 AM problem with regular expressions in Firefox
Novice Talker

Posts: 8
I have bthis function i use to validate data in an input field.

Code:
	
validateFunctions["float"] = function(id)
	{
		sender = document.getElementById(id);
		if ((sender.value != '') && !(/^\s*\d+([\.,]\d+)?\s*$/g).test(sender.value))
		{
			sender.style.backgroundColor = 'red';
			setTimeout("document.getElementById('"+id+"').style.backgroundColor = 'white';",400);
			return false;
		}
	};
It generally works, the problem is, while in IE the value with "," (for example "4,1") doesn't cause any problems, it is "flashed" invalid in Firefox.

What's up with FFox's regexp engine? O r is it IE bug combined with wrong regexp?
Ravenn is offline
Reply With Quote
View Public Profile Visit Ravenn's homepage!
 
When You Register, These Ads Go Away!
Reply     « Reply to problem with regular expressions in Firefox
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10048 seconds with 12 queries