原生js带提示留言表单验证代码

原创 彭淇  2017-07-07 11:25:48  阅读 1978 次 评论 0 条

原生js带提示留言表单验证代码 
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    
     <title>原生js带提示留言表单验证代码</title>
    
    
    <meta name="Keywords" content="原生js带提示留言表单验证代码" />
    
    
    <meta name="description" content="原生js带提示留言表单验证代码" />
    
    <link href="http://img.chinaz.com/max-templates/passport/styles/topbar.css" type="text/css" rel="Stylesheet" />
    <link href="/style/style_kj.css" type="text/css" rel="stylesheet" />
    <link href="/style/demo.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="/style/js/jquery-1.2.pack.js"></script>
<script type="text/javascript">
var theme_list_open = false;
$(document).ready(function () {
	function fixHeight() {
		var headerHeight = $("#switcher").height();
		$("#iframe").attr("height", $(window).height()-84 + "px");
	}
	$(window).resize(function () {
		fixHeight();
	}).resize();
	//响应式预览
	$('.icon-monitor').addClass('active');
	$(".icon-mobile-3").click(function () {
		$("#by").css("overflow-y", "auto");
		$('#iframe-wrap').removeClass().addClass('mobile-width-3');
		$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
		$(this).addClass('active');
		return false;
	});

	$(".icon-mobile-2").click(function () {
		$("#by").css("overflow-y", "auto");
		$('#iframe-wrap').removeClass().addClass('mobile-width-2');
		$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
		$(this).addClass('active');
		return false;
	});

	$(".icon-mobile-1").click(function () {
		$("#by").css("overflow-y", "auto");
		$('#iframe-wrap').removeClass().addClass('mobile-width');
		$('.icon-tablet,.icon-mobile,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
		$(this).addClass('active');
		return false;
	});

	$(".icon-tablet").click(function () {
		$("#by").css("overflow-y", "auto");
		$('#iframe-wrap').removeClass().addClass('tablet-width');
		$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
		$(this).addClass('active');
		return false;
	});

	$(".icon-monitor").click(function () {
		$("#by").css("overflow-y", "hidden");
		$('#iframe-wrap').removeClass().addClass('full-width');
		$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
		$(this).addClass('active');
		return false;
	});
});
</script>
<script type="text/javascript">
function Responsive($a) {
	if ($a == true) $("#Device").css("opacity", "100");
	if ($a == false) $("#Device").css("opacity", "0");
	$('#iframe-wrap').removeClass().addClass('full-width');
	$('.icon-tablet,.icon-mobile-1,.icon-monitor,.icon-mobile-2,.icon-mobile-3').removeClass('active');
	$(this).addClass('active');
	return false;
};
</script>
</head>
<body id="by" style="overflow-y: hidden" >
<div id="switcher">
  <div class="center">
    <ul>
   
      <div id="Device">
        <li class="device-monitor"><a href="javascript:"><div class="icon-monitor"></div></a></li>
        <li class="device-mobile"><a href="javascript:"><div class="icon-tablet"> </div></a></li>
        <li class="device-mobile"><a href="javascript:"><div class="icon-mobile-1"> </div></a></li>
        <li class="device-mobile-2"><a href="javascript:"><div class="icon-mobile-2"> </div></a></li>
        <li class="device-mobile-3"><a href="javascript:"><div class="icon-mobile-3"> </div></a></li>
      </div>
     
<div id="footer-notice" class="kj_bottom">
	<div style=" width:980px; margin:0 auto">
		<p class="left cut">
			<span>名称:</span>
            <a href="/jiaoben/160708449660.htm" title="点击下载" class="down" target="_blank">原生js带提示留言表单验证代码</a>
			<span>类型:</span>
			<a href="/jiaoben/" title="脚本" target="_blank">脚本</a>
             
			<span>标签:</span><a href="/tag_jiaoben/js.html" target="_blank">js</a><a href="/tag_jiaoben/BiaoDan.html" target="_blank">表单</a><a href="/tag_jiaoben/BiaoDanYanZheng.html" target="_blank">表单验证</a><a href="/tag_jiaoben/TiShiBiaoDan.html" target="_blank">提示表单</a>
                        

		</p>
		
		<div class="clear"></div>
	</div>
</div>

	<script type="text/javascript">

	    var description = '原生js带提示留言表单验证代码: 原生js带提示留言表单验证代码是一款支持姓名验证,电子邮箱验证,手机号码验证,文本验证,验证码验证等表单代码。';



	    var sendT = {
	        getHeader: function () {
	            var g_title = description;
	            var re = /<[^<>]*?font[^<>]*?>/gi;
	            g_title = g_title.replace(re, "");
	            return g_title;
	        },
	        getFirstImgSrc: function () {
	            var allPageTags = document.getElementsByTagName("div");
	            for (var i = 0; i < allPageTags.length; i++) {
	                if (allPageTags[i].className == 'downtext') {
	                    if (allPageTags[i].getElementsByTagName("img")[0] && allPageTags[i].getElementsByTagName("img")[0].width > 200) {
	                        return allPageTags[i].getElementsByTagName("img")[0].src;
	                    }
	                    else {
	                        return null;
	                    }

	                }
	            }
	        },
	        getContent: function () {
	            var allPageTagss = document.getElementsByTagName("div");
	            for (var i = 0; i < allPageTagss.length; i++) {
	                if (allPageTagss[i].className == 'downtext') {
	                    return allPageTagss[i].innerHTML;
	                }
	            }
	        }
	    }



	    document.getElementById("fxwb").onclick = function () {
	        (function (s, d, e, r, l, p, t, z, c) {
	            var f = 'http://service.weibo.com/share/share.php?appkey=872996044&', u = z || d.location, p = ['url=', e(u), '&title=', e(sendT.getHeader()), '&source=', e(r), '&sourceUrl=', e(l), '&content=', c || 'gb2312', '&pic=', e(p || '')].join('');
	            function a() {
	                if (!window.open([f, p].join(''), 'mb', ['toolbar=0,status=0,resizable=1,width=440,height=430,left=', (s.width - 440) / 2, ',top=', (s.height - 430) / 2].join(''))) u.href = [f, p].join('');
	            };
	            if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();
	        })(screen, document, encodeURIComponent, 'CHINAZ', 'http://sc.chinaz.com/', sendT.getFirstImgSrc(), null, null, null);
	    }


	    function posttoWb() {
	        var _tt = description;
	        var _t = encodeURI(_tt.replace(/\s+$/, ''));
	        var _url = encodeURI(window.location);
	        var _appkey = encodeURI("258efff116d2466da9b7513cbae7de0b");
	        var _site = encodeURI('sc.chinaz.com');
	        var _pic = sendT.getFirstImgSrc();
	        var _u = 'http://v.t.qq.com/share/share.php?title=' + _t + '&url=' + _url + '&appkey=' + _appkey + '&site=' + _site + '&pic=' + _pic;
	        window.open(_u, '转播到腾讯微博', 'width=700, height=580, top=320, left=180, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
	    }

 
</script>
<script type="text/javascript" src="/js/softinfo.js.aspx?id=542345" defer="defer" charset="UTF-8"></script>
<div style="display:none">
<script src="http://s4.cnzz.com/stat.php?id=300636&web_id=300636" language="JavaScript"></script>
</div>
</body>
</html>

本文地址:https://www.pengqi.club/blog/75.html
版权声明:本文为原创文章,版权归 彭淇 所有,欢迎分享本文,转载请保留出处!

发表评论


表情

还没有留言,还不快点抢沙发?