Tuesday, February 13, 2007

Debugging Javascript in Visual Studio

I got this from a colleague:
  1. Open Microsoft Internet Explorer.
  2. On the Tools menu, click Internet Options.
  3. On the Advanced tab, locate the Browsing section, and uncheck the Disable script debugging check box, and then click OK.
  4. Close Internet Explorer.
  5. In your JavasSript function add the keyword debugger . This causes VS.NET to switch to debug mode when it runs that line.
EX : -
function OnLookup()
{
debugger;
var xr = new XMLHttpRequest();
6. Run your ASP.Net application in debug mode.

Thursday, February 08, 2007

Regular expressions for validating currency

Embedded as I am in globalizing applications I thought I would create this entry for future reference.

More than once I have to validate user input and more than once that input is a currency value. The currency symbols are not part of the expressions here.

For en-US or en-CA:

^(\d{1,3})(,\d{3})*(\.\d{2})?$

fr-CA currency formatting regular expression:

^(\d{1,3})(\s{1}\d{3})*(,\d{2})?$


Ttyl!