| Line -... |
Line 1... |
| - |
|
1 |
var customerId;
|
| 1 |
function formLoaded() {
|
2 |
function formLoaded() {
|
| 2 |
$("form#cd input").each(function(){
|
3 |
$("form#cd input").each(function(){
|
| 3 |
$(this).attr('autocomplete', 'off');
|
4 |
$(this).attr('autocomplete', 'off');
|
| 4 |
});
|
5 |
});
|
| 5 |
$('form#cd').validate({
|
6 |
$('form#cd').validate({
|
| Line 130... |
Line 131... |
| 130 |
customerAddress['state'] = $('select[name=state] option:selected').val();
|
131 |
customerAddress['state'] = $('select[name=state] option:selected').val();
|
| 131 |
customerAddress['pinCode'] = $("#pinCode").val();
|
132 |
customerAddress['pinCode'] = $("#pinCode").val();
|
| 132 |
customerAddress['phoneNumber'] = $("#alternatePhone").val();
|
133 |
customerAddress['phoneNumber'] = $("#alternatePhone").val();
|
| 133 |
customerAddress['country'] = "India";
|
134 |
customerAddress['country'] = "India";
|
| 134 |
console.log(customerAddress);
|
135 |
console.log(customerAddress);
|
| 135 |
var customerId = $('input.phone').data('id');
|
- |
|
| 136 |
doPostAjaxRequestWithJsonHandler(`${context}/customer/address/${customerId}`, JSON.stringify(customerAddress), function(response){
|
136 |
doPostAjaxRequestWithJsonHandler(`${context}/customer/address?customerId=${customerId}`, JSON.stringify(customerAddress), function(response){
|
| 137 |
$("#address-body").prepend(getAddressTr(response.response));
|
137 |
$("#address-body").prepend(getAddressTr(response.response));
|
| 138 |
});
|
138 |
});
|
| 139 |
});
|
139 |
});
|
| 140 |
|
140 |
|
| 141 |
}
|
141 |
}
|
| Line 350... |
Line 350... |
| 350 |
}
|
350 |
}
|
| 351 |
var customer = response.response;
|
351 |
var customer = response.response;
|
| 352 |
$('#firstName').attr('value', customer.firstName);
|
352 |
$('#firstName').attr('value', customer.firstName);
|
| 353 |
$('#lastName').attr('value', customer.lastName);
|
353 |
$('#lastName').attr('value', customer.lastName);
|
| 354 |
$('#alternatePhone').attr('value', customer.mobileNumber);
|
354 |
$('#alternatePhone').attr('value', customer.mobileNumber);
|
| 355 |
$('input.phone').attr('value', customer.mobileNumber).attr('readonly', true).data("id",customer.customerId);
|
355 |
customerId = customer.customerId;
|
| 356 |
$('input.firstName').attr('value', customer.firstName).attr('readonly', true);
|
356 |
$('input.firstName').attr('value', customer.firstName).attr('readonly', true);
|
| 357 |
$('input.lastName').attr('value', customer.lastName).attr('readonly', true);
|
357 |
$('input.lastName').attr('value', customer.lastName).attr('readonly', true);
|
| 358 |
if(customer.emailId!=null) {
|
358 |
if(customer.emailId!=null) {
|
| 359 |
$('#email').attr('value', customer.emailId).attr('readonly', true);
|
359 |
$('#email').attr('value', customer.emailId).attr('readonly', true);
|
| 360 |
}
|
360 |
}
|