53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
function onChangeState() {
|
|
|
|
var stateCode = $('#state').val();
|
|
var method = "";
|
|
var inputUrl = "";
|
|
|
|
portalUtil.showMainLoading(true);
|
|
method = "GET";
|
|
inputUrl = contextPath +'/ref/cityByState?stateCode=' + stateCode;
|
|
|
|
$.ajax({
|
|
headers: { 'X-CSRF-Token': csrf_token },
|
|
type: method,
|
|
url: inputUrl
|
|
|
|
}).done(function(data) {
|
|
console.log(data);
|
|
|
|
var cityList = data;
|
|
|
|
$select = $("#city");
|
|
$select.empty();
|
|
$select.append("<option value ='' selected='selected'>- Please Select -</option>");
|
|
|
|
if (cityList != null && cityList.length != 0) {
|
|
for (var s = 0; s < cityList.length; s++) {
|
|
$select.append("<option value ='" + cityList[s].cityCode + "'>" + cityList[s].cityDesc + "</option>");
|
|
}
|
|
}
|
|
|
|
portalUtil.showMainLoading(false);
|
|
});
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
component.initFile();
|
|
});
|
|
|
|
$("form").submit(function() {
|
|
});
|
|
|
|
|
|
function hidePic(e) {
|
|
var checkbox = e.target;
|
|
if (checkbox.checked) {
|
|
document.getElementById('picOwner').hidden = true;
|
|
} else {
|
|
$('#sameAsOwner').val("false");
|
|
document.getElementById('picOwner').hidden = false;
|
|
}
|
|
}
|
|
|