1. function onlyNumbers(){
  2. if($('#GoalQuestionValue').val().toString().length>10) return false;
  3. if($('#GoalQuestionValue').val().indexOf('.') != -1 && $('#GoalQuestionValue').val().toString().length-$('#GoalQuestionValue').val().indexOf('.') >2) return false;
  4. }
  5.  
  6. function onlyNumbers(){
  7. var n = $('#GoalQuestionValue').val().toString().split('.');
  8. if(n[0].length > 8 || n[0].length < 2) return false; else return true;
  9. }
  10.  
  11. $("#GoalQuestionValue").keypress(function (e) {
  12. if (e.keyCode >= 48 && e.keyCode <= 57) {
  13. if (!isValidNumberStr(this.value)) return false;
  14. }
  15. })
  16.  
  17. function onlyNumbers() {
  18. var myArray = $('#GoalQuestionValue').val().toString().match(/([0-9]*).?([0-9]*)?/);
  19. if(myArray[1]) {
  20. if(myArray[1].length > 10)
  21. return false;
  22. if(myArray[2]) {
  23. if( myArray[2].length > 2 )
  24. return false;
  25. if( myArray[1].length + myArray[2].length > 10)
  26. return false;
  27. }
  28. return true;
  29. }
  30. return false;
  31. }