User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 373,099 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,848 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Float value checking

Join Date: Oct 2007
Location: Penang Island, Malaysia
Posts: 165
Reputation: lordx78 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
lordx78's Avatar
lordx78 lordx78 is offline Offline
Junior Poster

Help Float value checking

  #1  
Mar 23rd, 2008
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function validateFloat()
  5. {
  6. var o = document.frmInput.txtInput;
  7. switch (isFloat(o.value))
  8. {
  9. case true:
  10. alert(o.value + " is an float")
  11. break;
  12. case false:
  13. alert(o.value + " is not an float")
  14. }
  15. }
  16.  
  17. </script>
  18. </head>
  19. <body>
  20. <form name="frmInput">
  21. Enter something: <input name="txtInput" size="4">
  22. <input type="button" value="Validate" onclick="validateFloat()"></input>
  23. </form>
  24. </body>
  25. </html>

Not working. pls help
Last edited by lordx78 : Mar 23rd, 2008 at 6:12 am.
"I might not be the BEST but I'm not like the REST!"
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 5:02 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC