网页表单手机号验证
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <script type="text/javascript"> function checkForm(o){ var re=/^(13[0-9]{9})|(15[0-9][0-9]{8})|(18[0-9][0-9]{8})|(17[0-9][0-9]{8})$/; if(!re.test(o.phone.value)){ alert('请输入正确的手机号码。'); return false; }} </script> <h4>发送留言</h4> <form action="/plus/diy.php" enctype="multipart/form-data" method="post" onSubmit="return checkForm(this)"> <input type="hidden" name="action" value="post"/> <input type="hidden" name="diyid" value="1"/> <input type="hidden" name="do" value="2"/> <ul> <li class="field"> <div class="input"> <label for="name">姓名:</label> <input name="name" id="name" type="text" size="20" maxlength="50" class="text"/> </div> </li> <li class="field"> <div class="input"> <label for="phone">电话:</label> <input name="phone" id="phone" type="text" size="40" maxlength="50" class="text"/> </div> </li> <li class="field"> <div class="input"> <label for="email">邮箱:</label> <input name="email" id="email" type="text" size="40" maxlength="50" class="text"/> </div> </li> <li class="field"> <div class="input"> <label for="content">留言内容:</label> <textarea name="content" id="content" cols="60" rows="6" class="textarea"></textarea> </div> </li> <input type="hidden" name="dede_fields" value="name,text;phone,text;email,text;content,multitext" /> <input type="hidden" name="dede_fieldshash" value="6fbb1c8cc1dd6271328ca6eade8c6a91" /> <li class="submit-field"> <div class="input clearfix"> <input type="submit" value="提交" class="btn-submit"/> <input type="reset" value="重置" class="btn-reset"/> </div> </li> </ul> </form> |
浅唱6(微信/QQ号:909912499),欢迎分享本文,转载请保留出处!部分内容来自网络,如有侵权请联系删除处理!
相关信息
本站提供代码修改,dedecms,WordPress仿站二次开发 / PHP网站建设以及SEO优化等网络营销推广等服务。
如有需要请加QQ: 909912499