layui 表单验证案例文本框,手机,邮箱,textarea等格式的验证

文本框,手机,邮箱,textarea等格式的验证



 

 


HTML代码:

[html]  view plain  copy
  1. <form class="layui-form" action="">  
  2.                           <div class="layui-form-item">  
  3.                             <label class="layui-form-label">反馈主题label>  
  4.                             <div class="layui-input-block">  
  5.                               <input name="title" class="layui-input" type="text" placeholder="请输入标题" autocomplete="off" lay-verify="title">  
  6.                             div>  
  7.                           div>  
  8.                           <div class="layui-form-item">  
  9.                             <label class="layui-form-label">姓名label>  
  10.                             <div class="layui-input-block">  
  11.                               <input name="fname" class="layui-input" type="text" placeholder="请输入姓名" autocomplete="off" lay-verify="fname">  
  12.                             div>  
  13.                           div>  
  14.                           <div class="layui-form-item">  
  15.                             <label class="layui-form-label">手机label>  
  16.                             <div class="layui-input-block">  
  17.                               <input name="phone" class="layui-input" type="tel" autocomplete="off" placeholder="请输入手机" lay-verify="phone">  
  18.                             div>  
  19.                           div>  
  20.                           <div class="layui-form-item">  
  21.                             <label class="layui-form-label">邮箱label>  
  22.                             <div class="layui-input-block">  
  23.                               <input name="email" class="layui-input" type="text" autocomplete="off" placeholder="请输入邮箱" lay-verify="email">  
  24.                             div>  
  25.                           div>  
  26.                           <div class="layui-form-item">  
  27.                             <label class="layui-form-label">单选框label>  
  28.                             <div class="layui-input-block">  
  29.                               <input name="sex" title="男" type="radio" checked="" value="男">  
  30.                               <input name="sex" title="女" type="radio" value="女">  
  31.                               <input name="sex" title="保密" type="radio" value="密">  
  32.                             div>  
  33.                           div>  
  34.                           

你可能感兴趣的:(Web前端)