Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

how to match a input value with the regular expression in dynamics crm 2011?

$
0
0

Hi,

At the contact form I have a field name as Extension (new_ext). and at the onChnage event I want to do check weather the user has enter the number or anything else. I have the following piece of code.

function formatPhone(phonenum)
{
var ext =phonenum.getEventSource().getValue();
  var reg = /^[0-9]$/;
if(ext.match(reg))
{
alert("Valid");
}
else
{
alert("invalid");
}
}

It returns me always invalid even if I enter a letter or a number or both.

I want to seek your kind suggestions and help regarding this.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>