Compare commits

...

2 Commits

Author SHA1 Message Date
Kang Lee 65ddd4109d Merge branch 'master' of https://git.greenoilinc.com/hyojin.ahn/goiintra 2026-05-19 15:38:47 -04:00
Kang Lee 68d4944c47 v1.2.31
- [CUSTOMER] 유령문자 입력 방지
2026-05-19 15:38:17 -04:00
1 changed files with 31 additions and 0 deletions

View File

@ -3006,4 +3006,35 @@ function buildContent(property) {
$(".shortinput-store-name").text(property.name);
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// 1. 유령 글자 제거 함수
function cleanGhost(str) {
if (typeof str !== 'string') return str;
return str.replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g, "").trim();
}
// 2. 적용할 버튼들을 목록으로 만듭니다 (id1과 id3)
const buttons = ['customer-button-id1', 'customer-button-id3'];
buttons.forEach(function(id) {
const btn = document.getElementById(id);
if (btn) {
btn.addEventListener('click', function() {
// 3. 버튼 클릭 시 모든 텍스트 입력창 청소
// Restaurant Info와 Contact Info의 모든 input을 잡기 위해 범위를 넓게 잡습니다.
const allInputs = document.querySelectorAll('input[type="text"], textarea');
allInputs.forEach(function(input) {
if (input.value) {
input.value = cleanGhost(input.value);
}
});
});
}
});
});
</script>