- <html>
- <head>
- <title>Sample Code</title>
- <script type="text/javascript">
- function CheckFloatingPoint(ValueNumeric)
- {
- var objRegex = /(^-?\d\d*\.\d\d*$)|(^-?\.\d\d*$)/;
- //check for numeric characters
- if(objRegex.test(ValueNumeric))
- {
- alert("Your Given Input \""+ValueNumeric+"\" Is Correct.");
- }
- else
- {
- alert("Your Given Input\""+ValueNumeric+"\" Is Not Correct.");
- }
- }
- </script>
- </head>
- <body bgcolor=#00ff00 alink=blue vlink=blue>
- <FORM name="windowEvent">
- Number : <input type="text" name="txtnumber" />
- <input type="button" value="Check Floating Point" name="btnCheckFloatingPoint" onClick="CheckFloatingPoint(txtnumber.value)" />
- </FORM>
- </body>
- </html>
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Mahesh ChandPosted Apr 10, 2011, 10:28 PM
Welcome Ghanshyam! Small advice. Try not to use capital letters in a sentence and write a brief description about the blog. See this one. I have changed it.