Click here to Skip to main content
14,664,507 members
Rate this:
Please Sign up or sign in to vote.
See more:
HI Iam getting a number in this format "(8,000)" so when iam checking with convert.todouble it is throwing error .so how can i check if the number contains () then i dont want to check how can i validate this

Thanks in advance

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You can use Javascript. call this following function on onblur event of textbox. here is javascript function

if(!(document.getElementById(txtBox).value-indexOf("(")== "-1" || document.getElementById(txtBox).value-indexOf(")")== "-1" ))
  alert("Brackets are not allowed");
  return false;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100