html :Wordpress ::插件::简报:简单的表单设置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html :Wordpress ::插件::简报:简单的表单设置相关的知识,希望对你有一定的参考价值。

HTML Snippet to be used with Wordpress 'Newsletters' plugin
=====
 1. go to Admin_Menu->Newsletters->Subscription_Forms->Alternative_Forms {Enter the code below into a form box}
 2. Insert Newsletter module into a widget and enter {subscription_form_x} where x is the number of the alternative form box you entered the code in from above.
<script type="text/javascript">
//<![CDATA[
if (typeof newsletter_check !== "function") {
window.newsletter_check = function (f) {
    var re = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-]{1,})+\.)+([a-zA-Z0-9]{2,})+$/;
    if (!re.test(f.elements["ne"].value)) {
        alert("Please Enter a valid email");
        return false;
    }
    if (f.elements["nn"] && (f.elements["nn"].value == "" || f.elements["nn"].value == f.elements["nn"].defaultValue)) {
        alert("Please enter a valid name");
        return false;
    }
    if (f.elements["ny"] && !f.elements["ny"].checked) {
        alert("You must accept the privacy statement");
        return false;
    }
    return true;
}
function subscribe()
{
var form = document.getElementById("subscribe_form");
form.submit();
}
}
//]]>
</script>
<div class="newsletter newsletter-subscription">
<form method="post" id="subscribe_form" action="http://localhost:8081/hub/wordpress/wp-content/plugins/newsletter/do/subscribe.php" onsubmit="return newsletter_check(this)">

<!-- first name -->
<div class="form-row">
	<input class="newsletter-firstname" type="text" name="nn" size="40" aria-required="true" placeholder="Name" required>
</div>
<!-- email -->
<div class="form-row">
	<input class="newsletter-email" type="email" name="ne" size="40" aria-required="true" placeholder="Email" required>
</div>

<div class="module-button-row group">
	<a style="font-size:100%; height:auto;" class="button group lightbrown small text-size-100% text-weight-thick" onclick="subscribe();">
		SUBSCRIBE
	<i class="fa fa-arrow-circle-right"></i></a>
</div>

</form>
</div>

以上是关于html :Wordpress ::插件::简报:简单的表单设置的主要内容,如果未能解决你的问题,请参考以下文章

Wordpress 插件 HTML Bootstrap + PHP

WordPress文章目录插件LuckyWP Table of Contents设置教程

AI简报20210618期AI高仿你的笔迹只需1个词与你共享300 + 开源模型

html HTML电子邮件简报提示和技巧

html HTML电子邮件简报提示和技巧

html HTML电子邮件简报提示和技巧