Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onlyNumbers(){
- if($('#GoalQuestionValue').val().toString().length>10) return false;
- if($('#GoalQuestionValue').val().indexOf('.') != -1 && $('#GoalQuestionValue').val().toString().length-$('#GoalQuestionValue').val().indexOf('.') >2) return false;
- }
- function onlyNumbers(){
- var n = $('#GoalQuestionValue').val().toString().split('.');
- if(n[0].length > 8 || n[0].length < 2) return false; else return true;
- }
- $("#GoalQuestionValue").keypress(function (e) {
- if (e.keyCode >= 48 && e.keyCode <= 57) {
- if (!isValidNumberStr(this.value)) return false;
- }
- })
- function onlyNumbers() {
- var myArray = $('#GoalQuestionValue').val().toString().match(/([0-9]*).?([0-9]*)?/);
- if(myArray[1]) {
- if(myArray[1].length > 10)
- return false;
- if(myArray[2]) {
- if( myArray[2].length > 2 )
- return false;
- if( myArray[1].length + myArray[2].length > 10)
- return false;
- }
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement