House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Javascript validation

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alistair Davidson
05/27/2004 11:55 AM

if( isNaN( inputStr.parseFloat() ) ){   // it's Not a Number } else {   // it's OK } Alistair Davidson Senior Technical Developer Headshift.com Smarter, Simpler, Social

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/28/2004 04:10 AM

Really depends on what you want to allow. If you want to allow (digits OR digits.digits OR digits,ditgits) you could do function isNumber2(inputStr, field){   var pattern_number = /^\d+([,.]\d+)?$/   if(inputStr.length && !pattern_number.test(inputStr)){     alert("Please make sure your " + field + " entry are numbers ., only");     return false;   }   return true; } Pascal ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference