Click here to Skip to main content
15,897,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted

1 solution

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

C#
if(!(document.getElementById(txtBox).value-indexOf("(")== "-1" || document.getElementById(txtBox).value-indexOf(")")== "-1" ))
{
  alert("Brackets are not allowed");
  return false;
}
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900