久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      Javascript Validation for email(正則表達(dá)式) 英文翻譯

      Try testing the following form with valid and invalid email addresses. The
      code uses javascript to match the users input with a regular expression.
      函數(shù)代碼:

      復(fù)制代碼 代碼如下:
      function validate(form_id,email) {
      var reg = /^([A-Za-z0-9_-.])+@([A-Za-z0-9_-.])+.([A-Za-z]{2,4})$/;
      var address = document.forms[form_id].elements[email].value;
      if(reg.test(address) == false) {
      alert(‘Invalid Email Address’);
      return false;
      }
      }

      In the forms ‘onsubmit’ code call javascript:return validate(‘form_id’,’email_field_id’)
      使用方法:

      復(fù)制代碼 代碼如下:
      <form id=”form_id” method=”post” action=”action.php” onsubmit=”javascript:return validate(‘form_id’,’email’);”>
      <input type=”text” id=”email” name=”email” />
      <input type=”submit” value=”Submit” />
      </form>

      You should not rely purely on client side validation on your website / web application, if the user has javascript disabled this will not work. Always validate on the server.
      from: http://www.white-hat-web-design.co.uk/blog/javascript-validation/

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號