| 3101 |
chandransh |
1 |
var $items = $('#vtab>ul>li');
|
|
|
2 |
|
|
|
3 |
$items.click(function() {
|
|
|
4 |
$items.removeClass('selected');
|
|
|
5 |
$(this).addClass('selected');
|
|
|
6 |
trackEventWithGA('Payment Option', $(this).text(), "");
|
|
|
7 |
var index = $items.index($(this));
|
|
|
8 |
$('#vtab>div').hide().eq(index).show();
|
|
|
9 |
}).eq(0).click();
|
|
|
10 |
|
|
|
11 |
$items.hover(
|
|
|
12 |
function () {
|
|
|
13 |
$(this).addClass("hover");
|
|
|
14 |
},
|
|
|
15 |
function () {
|
|
|
16 |
$(this).removeClass("hover");
|
|
|
17 |
}
|
|
|
18 |
);
|
|
|
19 |
|
|
|
20 |
$("input[type='radio']").click(
|
|
|
21 |
function(){
|
|
|
22 |
var contents = $(this).parent().contents();
|
| 3182 |
chandransh |
23 |
var payment_method = contents.get(contents.index(this) + 2);
|
| 3101 |
chandransh |
24 |
//Appending the value to differentiate between the cases of cards issued inside and out of India.
|
| 3182 |
chandransh |
25 |
var payment_method_text = $(payment_method).text() + '-' + $(this).val();
|
| 3101 |
chandransh |
26 |
trackEventWithGA('Payment Option', payment_method_text, "");
|
|
|
27 |
}
|
|
|
28 |
);
|
|
|
29 |
|
|
|
30 |
function verifyPaymentModeSelectionForm(formName){
|
|
|
31 |
var payment_option = 0;
|
| 6086 |
anupam.sin |
32 |
var paymentOptionInputs = $("form[name='" + formName + "'] input[name='payment_option']");
|
| 3101 |
chandransh |
33 |
for(var i=0; i<paymentOptionInputs.length; i++)
|
|
|
34 |
if(paymentOptionInputs[i].checked)
|
|
|
35 |
payment_option = paymentOptionInputs[i].value;
|
|
|
36 |
|
|
|
37 |
if(payment_option == '' || payment_option <= 0){
|
|
|
38 |
dispError("Please select a payment method.");
|
|
|
39 |
return false;
|
|
|
40 |
}
|
|
|
41 |
trackPaymentOptionFormSubmission();
|
|
|
42 |
return true;
|
|
|
43 |
}
|
|
|
44 |
|
| 3312 |
chandransh |
45 |
function verifyCodSelectionForm(formName){
|
| 4656 |
phani.kuma |
46 |
var captcha_response_input =$("form[name='" + formName + "'] :input[name='captcha_response_field']");
|
|
|
47 |
var entered_text = $.trim(captcha_response_input.val());
|
|
|
48 |
if(entered_text == '' || entered_text == 'Enter the characters shown'){
|
| 3312 |
chandransh |
49 |
dispError("Please enter the characters shown.");
|
| 4656 |
phani.kuma |
50 |
captcha_response_input.blur();
|
| 3312 |
chandransh |
51 |
return false;
|
|
|
52 |
}
|
|
|
53 |
trackPaymentOptionFormSubmission();
|
|
|
54 |
return true;
|
|
|
55 |
}
|
|
|
56 |
|
| 3101 |
chandransh |
57 |
function trackPaymentOptionFormSubmission(){
|
|
|
58 |
trackEventWithGA('Order', 'Payment method selected', '');
|
|
|
59 |
return true;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
function dispError(error){
|
|
|
63 |
alert(error);
|
| 4656 |
phani.kuma |
64 |
}
|
|
|
65 |
|
|
|
66 |
$('#captchaanchor').click(function () { $('#captchaImage').attr('src', '/captcha?rand=' + Math.floor(Math.random()*100) ); });
|
|
|
67 |
|
|
|
68 |
$('#captcha_response_box').val('Enter the characters shown')
|
|
|
69 |
.focus(function(){
|
|
|
70 |
if ($(this).val() == 'Enter the characters shown') {
|
|
|
71 |
$(this).val('');
|
|
|
72 |
$(this).removeClass('captcha_text_blur');
|
|
|
73 |
$(this).addClass('captcha_text_focus');
|
|
|
74 |
}
|
|
|
75 |
})
|
|
|
76 |
.blur(function(){
|
|
|
77 |
if ($(this).val() == '') {
|
|
|
78 |
$(this).val('Enter the characters shown');
|
|
|
79 |
$(this).removeClass('captcha_text_focus');
|
|
|
80 |
$(this).addClass('captcha_text_blur');
|
|
|
81 |
}
|
|
|
82 |
});
|