欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

web站点常用js

shiping1 的头像

web站点常用js

分类: JavaScript 209人阅读 评论(0) 收藏 举报
[javascript] view plaincopyprint?
  1. <script>  
  2. function checkForm(inputName)  
  3. {  
  4.     if(inputName.member_no.value=="")  
  5.     {  
  6.         alert("请您输入学员编号 ! ");  
  7.         inputName.member_no.focus();  
  8.         return false;  
  9.     }  
  10.     if(inputName.member_name.value=="")  
  11.     {  
  12.         alert("请您输入学员编号 ! ");  
  13.         inputName.member_name.focus();  
  14.         return false;  
  15.     }  
  16.       
  17.     if(confirm("您确认要进行操作嘛 ? ")==true)  
  18.     {  
  19.         return true;  
  20.     }  
  21.     else  
  22.     {  
  23.         return false;  
  24.     }  
  25.       
  26. }  
  27. </script>  
  28.   
  29. <form action="#" method="post" target="_self" onsubmit="return checkForm(this);">  
  30.   <p>学员编号:  
  31.     <input type="text" name="member_no" />  
  32.   </p>  
  33.   <p>    <br />  
  34.     姓名:<input type="text" name="member_name" />  
  35.   </p>  
  36.   <p>  
  37.     <input type="submit" value="提 交" />  
  38.       <input type="reset" value="重 置" />  
  39.   </p>  
  40. </form>  
来自 http://blog.csdn.net/stellaah/article/details/7035461
普通分类: