E-mailコメント投稿フォームを搭載するには
- 0 : あまたのよ:3:42 午後
- 通常のコメントではなく、E-mailによるコメント投稿フォームのコード
<div class="hide" id="sendmail"> <form id="cSend" action="http://www.blogger.com/email-post.do" method="post"> <div class="comments-open"> <h2 class="comments-open-header">E-mail this post</h2> <div class="comments-open-content"> <input type="hidden" name="blogID" value="<$BlogID$>" /> <input type="hidden" name="postID" value="<$BlogItemNumber$>" /> <input type="hidden" name="returnTo" value="<$BlogURL$>" /> <input type="text" name="fromName" class="inputCom" id="fromName" size="20" value="Your name" onfocus="value=''" /> <input type="text" name="fromEmail" class="inputCom" id="fromEmail" size="20" value="Your email" onfocus="value=''" /> <input type="text" name="toEmail" class="inputCom" id="toEmail" size="20" value="Your friend's email" onfocus="value=''" /><br /> <input type="text" name="messageBody" class="inputCom" size="60" id="messageBody" value="Your message here" maxlength="300" onfocus="value=''"></textarea> <script type="text/javascript"> //<![CDATA[ var bgSended = false; var cSend = document.getElementById('cSend'); cSend.target = 'bgSend'; if (cSend.addEventListener) { cSend.addEventListener('submit', function(){return cSendPost()}, false); } else { cSend.onsubmit = function(){return cSendPost()}; } if (document.cookie != '') { cSend.fromName.value = document.cookie.replace(/^.*fromName=?([^;]*);?.*$/, '$1'); cSend.fromEmail.value = document.cookie.replace(/^.*fromEmail=?([^;]*);?.*$/, '$1'); } function cSendPost() { with (cSend) { fromName.value = fromName.value.replace(/^\s+|\s+$/g, ''); fromEmail.value = fromEmail.value.replace(/^\s+|\s+$/g, ''); if (fromName.value == '') { alert('Please enter your name'); fromName.focus(); return false; } if (fromEmail.value == '') { alert('Please enter your email'); fromEmail.focus(); return false; } if (toEmail.value == '') { alert('Please enter your friend\'s email'); toEmail.focus(); return false; } } bgSended = true; return true; } function bgSendLoad() { if (bgSended == true) { if (cSend.notforget.checked) { var expires = new Date(); expires.setFullYear(expires.getFullYear()+1); document.cookie = "fromName=" + unescape(cSend.fromName.value) + "; path=/" + "; expires=" + expires.toGMTString(); document.cookie = "fromEmail=" + unescape(cSend.fromEmail.value) + "; path=/" + "; expires=" + expires.toGMTString(); document.cookie = "anonName=" + unescape(cFrm.anonName.value) + "; path=/" + "; expires=" + expires.toGMTString(); document.cookie = "anonURL=" + unescape(cFrm.anonURL.value) + "; path=/" + "; expires=" + expires.toGMTString(); } alert('Your message has been sent'); } } document.write('<iframe style="position:absolute;left:-9999px;top:0" name="bgSend" onload="bgSendLoad()"></iframe>'); //]]> </script> <input type="submit" class="inputCom" name="post" value="Envoyer" /><br /> <input type="checkbox" id="notforget"> Remenber me (<a href="javascript:sh('explanation')">?</a>) <p class="hide" id="explanation"> <br /> <br /> All personal information that you provide here will be governed by the Privacy Policy of Blogger.com. <a href="http://www.blogger.com/terms.g">More...</a> </p> </div> </div> </form> </div> </div>
100 KB?
[ FC2が運営している 超格安料金 レンタルサーバー ]
新着レスの表示
掲示板に戻る
全部
コメント(0)
|