2014-01-28 50 views
0

HI我想用提交按鈕驗證輸入類型=電子郵件字段。 我在頁面中有兩個表單元素。我打開一個div(divForgotPassword)作爲模式。 但是所需的屬性不適用於模態。 下面是我的我的代碼使用輸入類型提交時,html5表單驗證不起作用

<form id="form1" runat="server"> 

//一些元素

<form id="form2" action="javascript:RetrievePassword();"> 
     <div id="divForgotPassword" style="display:none" title="Forgot password"> 

        <table> 
        <tr> 
         <td> 
          <asp:Label ID="lblForgotPassword" runat="server" Text="Email"></asp:Label>: 
         </td> 
         <td> 
          <input type="email" required="required" id="txtForgotEmail" /> 
         </td> 
        </tr> 
        <tr> 
         <td> 
          <input type="submit" style="background-image:url('Images/buttons/btn_send.png')" id="btnSend" /> 
         </td> 
        </tr> 
       </table> 


      </div> 
</form> 
+0

?並非所有流行瀏覽器都支持所有HTML5元素和屬性:[瀏覽器支持新HTML5輸入屬性](http://www.wufoo.com/html5/#attributes) – Ned

+0

Sandeep,您尚未爲任何HTML標記在你的代碼中輸入type =「email」。 –

+0

我正在使用Chrome瀏覽器。我想它支持html5 ..? –

回答

0
<form id="form2" action="javascript:RetrievePassword();"> 
<div id="divForgotPassword" title="Forgot password"> 
    <table> 
     <tr> 
      <td> 
       <label for="txtForgotEmail"> 
        EMAIL : </label> 
      <td> 

       <input type="email" required="required" id="txtForgotEmail" /> 
      </td> 
     </tr> 
     <tr> 
      <td> 
       <input type="submit" style="background-image:url('Images/buttons/btn_send.png')" id="btnSend" /> 
      </td> 
     </tr> 
    </table> 
</div> 

請找瀏覽器是否使用的是測試這個這個演示DEMO

相關問題