// Æû¸ÞÀÏ placehold Ãß°¡
$(function() {
if ($(".tbl_formmail").length > 0) {
var $form = $(".tbl_formmail");
$form.find('input[name=name]').attr('placeholder', 'Name');
$form.find('input[name=name]').attr('class', 'input-border-bottom');
$form.find('input[name=receiver_email]').attr('placeholder', 'Email');
$form.find('input[name=receiver_email]').attr('class', 'input-border-bottom');
$form.find('input[name=title1]').attr('placeholder', 'Subject');
$form.find('input[name=title1]').attr('class', 'input-border-bottom');
$form.find('textarea[name=description1]').attr('placeholder', 'Your Message');
$form.find('textarea[name=description1]').attr('class', 'input-border-bottom');
}
});
// tbl_formmail_sub1
$(function() {
if ($(".tbl_formmail_sub").length > 0) {
var $form = $(".tbl_formmail_sub");
$form.find('input[name=name]').attr('placeholder', 'Name');
$form.find('input[name=name]').attr('class', 'big-input');
$form.find('input[name=receiver_email]').attr('placeholder', 'Email');
$form.find('input[name=receiver_email]').attr('class', 'big-input');
$form.find('input[name=title1]').attr('placeholder', 'Subject');
$form.find('input[name=title1]').attr('class', 'big-input');
$form.find('input[name=add1]').attr('placeholder', 'Phone Number');
$form.find('input[name=add1]').attr('class', 'big-input');
$form.find('textarea[name=description1]').attr('placeholder', 'Your Message');
$form.find('textarea[name=description1]').attr('class', 'big-input');
}
});
// tbl_formmail_sub2
$(function() {
if ($(".tbl_formmail_sub2").length > 0) {
var $form = $(".tbl_formmail_sub2");
// ±âÁ¸ placeholder ¼¼ÆÃ (±×´ë·Î µÎ¼Åµµ µÇ°í ÇÊ¿ä ¾øÀ¸¸é »èÁ¦)
$form.find('input[name=name]').attr('placeholder', '¼ºÇÔ').addClass('input-border-bottom');
$form.find('input[name=receiver_email]').attr('placeholder', 'À̸ÞÀÏ').addClass('input-border-bottom');
$form.find('input[name=title1]').attr('placeholder', 'Á¦¸ñ').addClass('input-border-bottom');
$form.find('input[name=add1]').attr('placeholder', '¿¬¶ôó').addClass('input-border-bottom');
$form.find('input[name=add3]').attr('placeholder', '¿¹½ÄÀå¼Ò').addClass('input-border-bottom');
$form.find('input[name=add4]').attr('placeholder', '1¼øÀ§ ÁöÁ¤Ç÷¡³Ê').addClass('input-border-bottom');
$form.find('textarea[name=description1]').attr('placeholder', '±âŸ¹®ÀÇ»çÇ×').addClass('input-border-bottom');
// 🔹 ¿¹½ÄÀÏ / ½Ã°£ (add2) ¡æ ±³Ã¼
var $add2 = $form.find('input[name=add2]');
if ($add2.length > 0) {
$add2.replaceWith(`
`);
}
}
});
// tbl_formmail_sub3
$(function() {
if ($(".tbl_formmail_sub3").length > 0) {
var $form = $(".tbl_formmail_sub3");
$form.find('input[name=name]').attr('placeholder', 'Name');
$form.find('input[name=name]').attr('class', 'input-bg');
$form.find('input[name=receiver_email]').attr('placeholder', 'Email');
$form.find('input[name=receiver_email]').attr('class', 'input-bg');
$form.find('input[name=title1]').attr('placeholder', 'Subject');
$form.find('input[name=title1]').attr('class', 'input-bg');
$form.find('input[name=add1]').attr('placeholder', 'Phone Number');
$form.find('input[name=add1]').attr('class', 'input-bg');
$form.find('textarea[name=description1]').attr('placeholder', 'Your Message');
$form.find('textarea[name=description1]').attr('class', 'input-bg');
}
});
// tbl_formmail_sub4
$(function() {
if ($(".tbl_formmail_sub4").length > 0) {
var $form = $(".tbl_formmail_sub4");
// ¼ºÇÔ
var $name = $form.find('input[name=name]');
if ($name.length > 0) {
$name.replaceWith(`
`);
}
// ¿¬¶ôó
var $phone = $form.find('input[name=add1]');
if ($phone.length > 0) {
$phone.replaceWith(`
`);
}
// À̸ÞÀÏ
var $email = $form.find('input[name=receiver_email]');
if ($email.length > 0) {
$email.replaceWith(`
`);
}
// ¿¹½ÄÀÏ / ½Ã°£ (PC/¸ð¹ÙÀÏ ¸ðµÎ placeholder Ç¥½Ã + ¹ØÁÙ 3µîºÐ)
var $add3 = $form.find('input[name=add3]');
if ($add3.length > 0) {
$add3.replaceWith(`
`);
const weddingInput = document.getElementById("weddingDate");
const weddingHour = document.getElementById("weddingHour");
const weddingMinute = document.getElementById("weddingMinute");
const finalWedding = document.getElementById("finalWeddingDate");
// ½ºÅ¸ÀÏ(±âÁ¸ ½ºÅ¸ÀÏ µ¤¾î¾²±â + fake placeholder)
if ($("#datePlaceholderStyle").length === 0) {
$("head").append(`
`);
}
const $fake = $(weddingInput).siblings('.fake-placeholder');
// hidden input ¾÷µ¥ÀÌÆ®
function updateFinalValue() {
const date = weddingInput.value;
const hour = weddingHour.value;
const minute = weddingMinute.value;
let finalValue = date || "";
if (hour || minute) {
finalValue += (finalValue ? " " : "") + `${hour.toString().padStart(2,"0")}:${(minute || "00")}`;
}
finalWedding.value = finalValue;
}
// placeholder Ç¥½Ã/¼û±è
function updatePlaceholder() {
if (weddingInput.value) {
$fake.hide();
weddingInput.style.color = ""; // ³¯Â¥ ÅØ½ºÆ® Ç¥½Ã
weddingInput.style.webkitTextFillColor = "";
} else {
$fake.show();
weddingInput.style.color = "transparent"; // fake placeholder º¸¿©ÁÖ±â
weddingInput.style.webkitTextFillColor = "transparent";
}
}
// À̺¥Æ® ¹ÙÀεù
weddingInput.addEventListener('input', updatePlaceholder);
weddingInput.addEventListener('change', function() { updatePlaceholder(); updateFinalValue(); });
weddingInput.addEventListener('focus', function() { if (this.showPicker) try { this.showPicker(); } catch(e){} });
weddingInput.addEventListener('blur', updatePlaceholder);
weddingInput.addEventListener('click', function() { if (this.showPicker) try { this.showPicker(); } catch(e){}; setTimeout(updatePlaceholder,100); });
weddingHour.addEventListener('change', updateFinalValue);
weddingMinute.addEventListener('change', updateFinalValue);
// ÃʱâÈ
updatePlaceholder();
updateFinalValue();
}
// ¿¹½ÄÀå¼Ò
var $add4 = $form.find('input[name=add4]');
if ($add4.length > 0) {
$add4.replaceWith(`
`);
}
// ÁöÁ¤Ç÷¡³Ê
var $add5 = $form.find('input[name=add5]');
if ($add5.length > 0) {
$add5.replaceWith(`
`);
}
// ±âŸ¹®ÀÇ»çÇ×
var $desc = $form.find('textarea[name=description1]');
if ($desc.length > 0) {
$desc.replaceWith(`
`);
}
// --- (±âÁ¸ ½ºÅ©¸³Æ® ³»ºÎ) ---
// üũ¹Ú½º ½ºÅ¸ÀÏ ÅëÇÕ (¿¹½ÄÀÏ ¹ÌÁ¤ + °³ÀÎÁ¤º¸ µ¿ÀÇ)
(function() {
// CSS ÇÑ ¹ø¸¸ Ãß°¡
if ($("#customCheckboxStyle").length === 0) {
$("head").append(`
`);
}
// ---- ¿¹½ÄÀÏ ¹ÌÁ¤ (add6) ó¸® ----
const $add6 = $form.find("input[name='add6[]']");
if ($add6.length > 0) {
// ±âÁ¸ name Á¦°Å(ÀÌ¹Ì Çϼ̴ٸé Áߺ¹ Á¦°ÅµÇÁö ¾ÊÀ½)
$add6.removeAttr("name");
$add6.each(function() {
var $cb = $(this);
// ·¡ÇÎ & ÀεðÄÉÀÌÅÍ + ÅØ½ºÆ® »ðÀÔ
if (!$cb.parent("label.custom-checkbox").length) {
// label.custom-checkbox ³»ºÎ ±¸Á¶:
$cb.wrap('');
$cb.after('¿¹½ÄÀÏ ¹ÌÁ¤');
}
// ¿¹Àü ÄÚµåó·³ ¿¹½ÄÀÏ ¹ÌÁ¤ ¾È³» ¹®±¸¸¦ td ¾Õ¿¡ Ãß°¡ (ÀÖÀ¸¸é Áߺ¹ ¹æÁö)
if ($cb.closest("td").find('.undecided-text').length === 0) {
$cb.closest("td").prepend('¿¹½ÄÀÏ ¹ÌÁ¤ÀÏ °æ¿ì üũ ºÎʵ右´Ï´Ù.
');
}
});
// ¼û±è Àü¼Û¿ë input (°ª ¼³Á¤)
if ($form.find("input[name='add6']").length === 0) {
$form.append('');
}
const $hiddenAdd6 = $form.find("input[name='add6']");
// üũ ¿©ºÎ¿¡ µû¶ó °ª ¼³Á¤
$add6.on("change", function () {
$hiddenAdd6.val($(this).is(":checked") ? "O" : "X");
});
$add6.trigger("change");
}
$form.find("input[name='com_formmail_check_safe']").each(function() {
var $cb = $(this);
var text = "°³ÀÎÁ¤º¸ ¼öÁý ¹× ÀÌ¿ë µ¿ÀÇ";
if (!$cb.parent("label.custom-checkbox").length) {
// 1) ¶óº§·Î °¨½Î±â
$cb.wrap('');
// 2) ÅØ½ºÆ® ¸ÕÀú, indicator ´ÙÀ½, üũ¹Ú½º input´Â µÚ·Î
$cb.after(''); // ÀεðÄÉÀÌÅÍ
$cb.closest('label.custom-checkbox').prepend('' + text + '');
// 3) label Àüü¸¦ Áß¾ÓÁ¤·Ä div·Î °¨½Î±â
$cb.closest('label.custom-checkbox').wrap('');
}
});
})();
// 🔹 CSS µ¿Àû »ðÀÔ (ÅëÇÕ)
$("head").append(`
`);
}
});