Compare commits
2 Commits
a70e5feee8
...
65ddd4109d
| Author | SHA1 | Date |
|---|---|---|
|
|
65ddd4109d | |
|
|
68d4944c47 |
|
|
@ -3007,3 +3007,34 @@ function buildContent(property) {
|
|||
}
|
||||
|
||||
</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>
|
||||
Loading…
Reference in New Issue