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(""); if (cityList != null && cityList.length != 0) { for (var s = 0; s < cityList.length; s++) { $select.append(""); } } 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; } }