Hi,
I'm adding some JavaScript code to my ASP.NET page. Here's my JavaScript function as it appears in the web page source:
<script language='JavaScript' type='text/javascript'>
function isNumeric(x) {
var RegExp = /^(-)?(\d*)(\.?)(\d*)$/;
var result = x.match(RegExp);
return result;}
</script>
This bombs on the x.match(RegExp) line. I receive the following error:
Microsoft JScript runtime error: Object doesn't support this property or method
It can't find the 'match' function I guess, but why am I receiving a JScript error when my code is in JavaScript? I'm assuming that's why it can't find it. I've tried specifying just the language tag and just the type tag, but it doesn't eliminate the error.
Any help is appreciated.
I'm adding some JavaScript code to my ASP.NET page. Here's my JavaScript function as it appears in the web page source:
<script language='JavaScript' type='text/javascript'>
function isNumeric(x) {
var RegExp = /^(-)?(\d*)(\.?)(\d*)$/;
var result = x.match(RegExp);
return result;}
</script>
This bombs on the x.match(RegExp) line. I receive the following error:
Microsoft JScript runtime error: Object doesn't support this property or method
It can't find the 'match' function I guess, but why am I receiving a JScript error when my code is in JavaScript? I'm assuming that's why it can't find it. I've tried specifying just the language tag and just the type tag, but it doesn't eliminate the error.
Any help is appreciated.