Revision 5841646f snf-astakos-app/astakos/im/static/im/js/quotas.js

b/snf-astakos-app/astakos/im/static/im/js/quotas.js
9 9
			$(this).find('input')[0].focus()
10 10
		}
11 11
	});
12
	
12
	if ($('.quotas-form .with-info .with-errors input[type="text"]')){
13
		$(this)[0].focus();	
14
	}
15

  
13 16
}
14 17

  
15 18

  
......
116 119
			 	value = value.replace(",",".");
117 120
			 	var num = parseFloat(value);
118 121
			 	
119
			 	if ( value && !num ) { flag = 1}
122
			 	if ( value && !num ) { flag = 1 ; msg="Invalid format"}
120 123
			 	
121 124
			 	var bytes = num;
122 125
		 		
......
148 151
				 		  bytes = num; 
149 152
			 		}
150 153
			 	} else {
151
			 		if (value) {
152
			 		 flag = 1;
153
			 		}
154
			 		if (num) {
155
			 		 	flag = 1;
156
			 		 	msg ="You must specify correct units" 
157
			 		}  
154 158
			 		 
155 159
			 	}
156 160
			 	
157 161
			 	if ( flag == '1' ){ 
158 162
			 		$(this).parents('.form-row').addClass('with-errors');
163
			 		$(this).parents('.form-row').find('.error-msg').html(msg);
159 164
			 		bytes = value;
160 165
			 		$(this).focus();
161 166
			 		
......
173 178
	
174 179
		 		var is_int = value.match (new RegExp('^[0-9]*$'));
175 180
		 		if ( !is_int ){ 
176
		 			$(this).parents('.form-row').find('.error-msg').html('Enter a whole number');
181
		 			$(this).parents('.form-row').find('.error-msg').html('Enter a positive intiger');
177 182
			 		$(this).parents('.form-row').addClass('with-errors');
178 183
			 		 
179 184
			 	} else {

Also available in: Unified diff