fix : 상품관리 > 상품조회 > 상품 등록/복사재등록/수정 - input 값 trim 공통함수 추가

This commit is contained in:
이대환
2026-10-14 16:51:43 +09:00
parent 6ac4a735f6
commit dd2a26643f
3 changed files with 16 additions and 8 deletions

View File

@@ -569,6 +569,8 @@
* 등록 AJAX * 등록 AJAX
******************************************************** */ ******************************************************** */
const fn_regist = function () { const fn_regist = function () {
trimInputValue();
const url = '<c:url value="/mngr/goods/goodsmngr/insertGoodsInfo"/>'; const url = '<c:url value="/mngr/goods/goodsmngr/insertGoodsInfo"/>';
const formData = new FormData(); const formData = new FormData();
@@ -1270,7 +1272,6 @@
formData.append('files', file); // 서버에서 파일을 받을 때 'files'라는 이름으로 전송 formData.append('files', file); // 서버에서 파일을 받을 때 'files'라는 이름으로 전송
}); });
trimInputValue();
if (confirm('상품을 <spring:message code="confirm.common.insert"/>')) { if (confirm('상품을 <spring:message code="confirm.common.insert"/>')) {
$.ajax({ $.ajax({
type: 'post', type: 'post',

View File

@@ -621,6 +621,7 @@
* 복사 등록 AJAX * 복사 등록 AJAX
******************************************************** */ ******************************************************** */
const fn_copy_regist = function () { const fn_copy_regist = function () {
trimInputValue();
const url = '<c:url value="/mngr/goods/goodsmngr/insertGoodsInfo"/>'; const url = '<c:url value="/mngr/goods/goodsmngr/insertGoodsInfo"/>';
const formData = new FormData(); const formData = new FormData();
@@ -1323,7 +1324,6 @@
}); });
if (confirm('상품을 <spring:message code="confirm.common.copyInsert"/>')) { if (confirm('상품을 <spring:message code="confirm.common.copyInsert"/>')) {
trimInputValue();
$.ajax({ $.ajax({
type: 'post', type: 'post',
enctype: 'multipart/form-data', enctype: 'multipart/form-data',

View File

@@ -1440,6 +1440,7 @@
//구매 대상자 제한 정보 저장 //구매 대상자 제한 정보 저장
const fn_save_purchase_limmit = function () { const fn_save_purchase_limmit = function () {
trimInputValue();
if ($('#purchase_limmit_hiddenForm') != null) { if ($('#purchase_limmit_hiddenForm') != null) {
$('#purchase_limmit_hiddenForm').remove(); $('#purchase_limmit_hiddenForm').remove();
@@ -1763,11 +1764,11 @@
******************************************************** */ ******************************************************** */
//카테고리 수정 //카테고리 수정
$(document).on('click', '#btn_update_category', function () { $(document).on('click', '#btn_update_category', function () {
trimInputValue();
if ($('#hiddenForm_categry') != null) {
if ($('#hiddenForm_categry') != null) { $('#hiddenForm_categry').remove();
$('#hiddenForm_categry').remove(); }
}
const url = '<c:url value="/mngr/goods/goodsmngr/updateGoodsDtlCtgryLink"/>'; const url = '<c:url value="/mngr/goods/goodsmngr/updateGoodsDtlCtgryLink"/>';
const hiddenForm = document.createElement('form'); const hiddenForm = document.createElement('form');
@@ -1804,6 +1805,7 @@
//상품 기본정보 수정 //상품 기본정보 수정
$(document).on('click', '#btn_update_BscInfo', function (event) { $(document).on('click', '#btn_update_BscInfo', function (event) {
event.preventDefault() event.preventDefault()
trimInputValue();
if ($('#hiddenForm_bscInfo') != null) { if ($('#hiddenForm_bscInfo') != null) {
$('#hiddenForm_bscInfo').remove(); $('#hiddenForm_bscInfo').remove();
@@ -1936,6 +1938,7 @@
// 상품 판매정보 수정 // 상품 판매정보 수정
$(document).on('click', '#btn_update_SelInfo', function () { $(document).on('click', '#btn_update_SelInfo', function () {
trimInputValue();
if ($('#hiddenForm_selInfo') != null) { if ($('#hiddenForm_selInfo') != null) {
$('#hiddenForm_selInfo').remove(); $('#hiddenForm_selInfo').remove();
@@ -2214,6 +2217,7 @@
//상품 옵션수정 //상품 옵션수정
$(document).on('click', '#btn_update_opt', function (event) { $(document).on('click', '#btn_update_opt', function (event) {
event.preventDefault() event.preventDefault()
trimInputValue();
if ($('#hiddenForm_opt') != null) { if ($('#hiddenForm_opt') != null) {
$('#hiddenForm_opt').remove(); $('#hiddenForm_opt').remove();
@@ -2645,6 +2649,8 @@
//상품 이미지 수정 //상품 이미지 수정
$(document).on('click', '#btn_update_img', function (event) { $(document).on('click', '#btn_update_img', function (event) {
event.preventDefault() event.preventDefault()
trimInputValue();
if($('#hiddenForm_img') != null) { if($('#hiddenForm_img') != null) {
$('#hiddenForm_img').remove(); $('#hiddenForm_img').remove();
} }
@@ -2717,6 +2723,8 @@
//상품 기타정보 수정 //상품 기타정보 수정
$(document).on('click', '[name="btn_update_EtcInfo"]', function (event) { $(document).on('click', '[name="btn_update_EtcInfo"]', function (event) {
event.preventDefault() event.preventDefault()
trimInputValue();
if($('#hiddenForm_etcInfo') != null) { if($('#hiddenForm_etcInfo') != null) {
$('#hiddenForm_etcInfo').remove(); $('#hiddenForm_etcInfo').remove();
} }
@@ -2841,7 +2849,7 @@
//관련상품 수정 //관련상품 수정
$(document).on('click','#btn_update_relateGoods', function (event) { $(document).on('click','#btn_update_relateGoods', function (event) {
event.preventDefault() event.preventDefault()
trimInputValue();
if($('#hiddenForm_relateGoods') != null) { if($('#hiddenForm_relateGoods') != null) {
$('#hiddenForm_relateGoods').remove(); $('#hiddenForm_relateGoods').remove();
@@ -2884,7 +2892,6 @@
//상품 개별 수정 ajax //상품 개별 수정 ajax
const updateAjaxInfo = (gubun, url, formData, sectionNo) =>{ const updateAjaxInfo = (gubun, url, formData, sectionNo) =>{
if (confirm(gubun+`을(를) <spring:message code="confirm.common.update"/>`)) { if (confirm(gubun+`을(를) <spring:message code="confirm.common.update"/>`)) {
trimInputValue();
$.ajax({ $.ajax({
type: 'post', type: 'post',
enctype: 'multipart/form-data', enctype: 'multipart/form-data',