时光静好,与君语;细水流年,与君同;繁华落尽,与君老……
🌐 Paulblog 📅 2008 — 2026

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

✍ 作者 gbl 📅 2019-08-25 📂 👁 116 阅读

织梦自定义表单用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();'>


暂无标签

评论

暂无评论...
验证码 换一张
取 消