xinlinux
 

<form class="form-horizontal" name="mobileform" style="padding:10px;"  onSubmit="return checkMobile();">
  <div class="span12">
    <span class="pull-left title-ipone">手机号:</span>
    <input class="span10 pull-right" name="mobile" type="number" placeholder="请输入手机号"/>
  </div>
  <div class="text-center span12 ml0">
    <button type="submit" class="btn btn-warning" style="margin-top:20px;">查 询</button>
  </div>

</form>





javascript 代码:

function checkMobile(){
var sMobile = document.mobileform.mobile.value if(sMobile==\'\'){ alert(\'请输入手机号\'); }else if(!(/^1[3|5][0-9]\d{4,8}$/.test(sMobile))){ alert("请输入正确的手机号码"); document.mobileform.mobile.focus(); return false; } }

 

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-12-10
  • 2021-12-10
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-12-10
猜你喜欢
  • 2021-10-03
  • 2021-08-16
  • 2021-12-31
  • 2021-08-16
  • 2021-10-27
  • 2022-12-23
相关资源
相似解决方案