武汉SEO
时光静好,与君语;细水流年,与君同;繁华落尽,与君老...

织梦技巧>正文

织梦自定义表单用js控制必填选项

2019-08-25 09:23

织梦自定义表单用js控制必填选项代码如下:

<script language='javascript'>function Checkfeedback() {if (document.myform.name.value.length == 0) {alert('您的姓名 不能为空');document.myform.name.focus();return false;}if (document.myform.qq.value.length == 0) {alert('QQ号码 不能为空');document.myform.qq.focus();return false;}if (document.myform.email.value.length == 0) {alert('email 不能为空');document.myform.email.focus();return false;}if (document.myform.tel.value.length == 0) {alert('手机 不能为空');document.myform.tel.focus();return false;}}</script>

 

 

<form action="http://127.0.0.1/plus/diy.php" method="post"name='myform' onSubmit='return Checkfeedback();'>


本文链接:https://www.0937.biz/post-1181.html

图文推荐
热门标签