// Sapphirus.Biz Group Mail function setEvent() { // 入力をクリア if ($('clear-mailaddress')) { $('clear-mailaddress').onclick = function() { $('mailaddress').value = ''; $('ht_name').value = ''; $('ht_company').value = ''; $('ht_post').value = ''; } } if ($('clear-mailsubject')) { $('clear-mailsubject').onclick = function() { $('mailsubject').value = ''; } } if ($('clear-mailmessage')) { $('clear-mailmessage').onclick = function() { $('mailmessage').value = ''; } } if ($('clear-mymailaddress')) { $('clear-mymailaddress').onclick = function() { $('mymailaddress').value = ''; $('mymailname').value = ''; } } if ($('sendmail')) { $('sendmail').onclick = function() { if (inputCheck() == false) return false; if (confirm("配信してよろしいですか?\n(デモのため実際の送信されません)")) { $('param').value = 'send'; $('groupmail-form').target = '_self'; $('groupmail-form').submit(); } else { return false; } } } if ($('confirm')) { $('confirm').onclick = function() { $('param').value = 'confirm'; window.open('', 'Preview'); $('groupmail-form').target = 'Preview'; $('groupmail-form').submit(); return false; } } // HELPを表示/非表示 var getLinkTag = document.getElementsByTagName('a'); for (var i = 0; i < getLinkTag.length; i++) { if (getLinkTag[i].href.match(/#help/i)) { $(getLinkTag[i].href.replace(/.*#/, '')).style.display = 'none'; getLinkTag[i].onclick = function() { var t = this.href.replace(/.*#/, ''); var e = $(t); if (e.style.display == 'none') e.style.display = 'block'; else e.style.display = 'none'; return false; } } } } function inputCheck() { var al = ''; if ($('mailaddress').value == '') al += "・配信先メールアドレス(相手先)が入力されてません\n"; if ($('mailsubject').value == '') al += "・メール件名が入力されてません\n"; if ($('mailmessage').value == '') al += "・メール本文が入力されてません\n"; if ($('mymailaddress').value == '') al += "・配信元メールアドレス(自分)が入力されていません\n"; if (al) { alert(al); return false; } return true; } function $(tagId) { return document.getElementById(tagId); } window.onload = setEvent;