Subversion Repositories SmartDukaan

Rev

Rev 6433 | Rev 6536 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6433 Rev 6495
Line 47... Line 47...
47
	$.validator.addMethod("rangeamount", function(value,element){	
47
	$.validator.addMethod("rangeamount", function(value,element){	
48
		return value >= 10 && value <= 1000;
48
		return value >= 10 && value <= 1000;
49
	}, "Recharge amount should be between Rs. 10-1000");
49
	}, "Recharge amount should be between Rs. 10-1000");
50
	
50
	
51
	$.validator.addMethod("rangeamount1", function(value,element){	
51
	$.validator.addMethod("rangeamount1", function(value,element){	
52
		return value >= 200 && value <= 10000;
52
		return value >= 200 && value < 10000;
53
	}, "Recharge amount should be between Rs. 200-10000");
53
	}, "Recharge amount should be between Rs. 200-9999");
54
	
54
	
55
	$.validator.addMethod("selectoperator", function(value,element){	
55
	$.validator.addMethod("selectoperator", function(value,element){	
56
		return $(element).find("option:selected").index()!=0;
56
		return $(element).find("option:selected").index()!=0;
57
	}, "Please select operator");
57
	}, "Please select operator");
58
	
58
	
Line 279... Line 279...
279
					$('#operatorSelector').trigger('change');
279
					$('#operatorSelector').trigger('change');
280
				}
280
				}
281
			}
281
			}
282
		});
282
		});
283
	}
283
	}
284
});
-
 
285
284
	
-
 
285
	jQuery('#applyRechargeCoupon').click(function() {
-
 
286
		var code = $.trim($('#discountCode').val());
-
 
287
		if ( code == '') {
-
 
288
			alert('No coupon applied');
-
 
289
		} else {
-
 
290
			$('#discountCode').val(code);
-
 
291
			jQuery('#create-recharge-form').attr('action', '/confirm!applyRechargeCoupon');
-
 
292
			jQuery('#create-recharge-form').submit();
-
 
293
		}
-
 
294
	});
-
 
295
 
-
 
296
	jQuery('#recharge-pay-now-button').click(function() {
-
 
297
		jQuery('#create-recharge-form').attr('action', '/confirm!createRecharge');
-
 
298
		jQuery('#create-recharge-form').submit();
-
 
299
	});
-
 
300
	
-
 
301
	jQuery('#recharge-now-button').click(function() {
-
 
302
		jQuery('#recharge-now-button').hide();
-
 
303
		var formName = "create-recharge-form";
-
 
304
		var captcha_response_input = jQuery("form[name='" + formName + "'] :input[name='captcha_response_field']");
-
 
305
    	var entered_text =  jQuery.trim(captcha_response_input.val());
-
 
306
        	if(entered_text == '' || entered_text == 'Enter the characters shown'){
-
 
307
        		dispError("Please enter the characters shown.");
-
 
308
        		captcha_response_input.blur();
-
 
309
				jQuery('#recharge-now-button').show();
-
 
310
				return;
-
 
311
        	}
-
 
312
		jQuery('#create-recharge-form').attr('action', '/confirm!createRecharge');
-
 
313
		jQuery('#captcha-div').append('<span id=\'recharge-loading\' style="display:inline-block;width:200px;height: 30px;background: url(\'/images/loading.gif\') no-repeat 8px 0;padding-left: 45px;padding-top: 7px;">Please Wait ...</span>');
-
 
314
    	jQuery('#create-recharge-form').submit();
-
 
315
	});
-
 
316
 
-
 
317
    function dispError(msg) {
-
 
318
    	alert(msg);
-
 
319
    }
-
 
320
	
-
 
321
	jQuery('#captchaanchor').click(function () { jQuery('#captchaImage').attr('src', '/captcha?rand=' + Math.floor(Math.random()*100) ); });
-
 
322
	
-
 
323
	jQuery('#captcha_response_box').val('Enter the characters shown')
-
 
324
	.focus(function(){
-
 
325
		if ($(this).val() == 'Enter the characters shown') {
-
 
326
			$(this).val('');
-
 
327
			$(this).removeClass('captcha_text_blur');
-
 
328
			$(this).addClass('captcha_text_focus');
-
 
329
		}
-
 
330
	})
-
 
331
	.blur(function(){
-
 
332
		if ($(this).val() == '') {
-
 
333
			$(this).val('Enter the characters shown');
-
 
334
			$(this).removeClass('captcha_text_focus');
-
 
335
			$(this).addClass('captcha_text_blur');
-
 
336
		}
-
 
337
	});
-
 
338
});
-
 
339
 
-
 
340