2013-05-07 53 views
0

我有以下模態對話框使用只CSS3在我的ASP頁面進行用戶註冊(彈出): HTML:如何重新打開純CSS3模態對話框

<%-- Modal PopUp starts here--%> 
<div id="openModal" class="modalDialog"> 
    <div> <a href="#close" title="Close" class="close" onclick="DisableAllPopUpTxt()">X</a> 

     <table style="width:100%;"> 
      <tr> 
       <td style="text-align: center; width: 100%;"></td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <asp:Label ID="lblErrorMSG2" runat="server" Font-Bold="True" ForeColor="#FF3300" Text="Email ID Already Taken " Visible="False"></asp:Label> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <input id="txtCustFName" name="txtCustFName" type="text" required placeholder="Enter Your First Name" style="width: 80%" /> 
       </td> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <input id="txtCustLName" name="txtCustLName" type="text" required placeholder="Enter Your Last Name" style="width: 80%" /> 
       </td> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <input id="txtCustREmail" name="txtCustREmail" type="email" required placeholder="Enter Valid Email ID" style="width: 80%" /> 
       </td> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <input id="txtCustRPwd" name="txtCustRPwd" type="password" required placeholder="Enter Password" style="width: 80%" /> 
       </td> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <input id="txtCustRePwd" name="txtCustRePwd" type="password" required placeholder="ReType Password" style="width: 80%" /> 
       </td> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> 
        <input id="txtCustPh" name="txtCustPh" type="number" size="10" min="10" max="10" required placeholder="Enter Valid Mobile No" style="width: 80%" /> 
       </td> 
       </td> 
      </tr> 
      <tr> 
       <td class="style1" style="text-align: center; width: 100%;" onclick="btnSignUp()"> 
        <asp:Button ID="btnSingUp" runat="server" onclick="signUp" Text="Login" /> 
       </td> 
      </tr> 
      <tr> 
       <td style="text-align: center; width: 100%;"> </td> 
      </tr> 
     </table> 
    </div> 
</div> 
<%--Modal PopUp Ends Here--%> 

CSS:

.modalDialog { 
    position: fixed; 
    font-family: Arial, Helvetica, sans-serif; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 0; 
    background: rgba(0,0,0,0.8); 
    z-index: 99999; 
    opacity:0; 
    -webkit-transition: opacity 400ms ease-in; 
    -moz-transition: opacity 400ms ease-in; 
    transition: opacity 400ms ease-in; 
    pointer-events: none; 
    } 

.modalDialog:target { 
    opacity:1; 
    pointer-events: auto; 
    } 

.modalDialog > div { 
    width: 400px; 
    position: relative; 
    margin: 10% auto; 
    padding: 5px 20px 13px 20px; 
    border-radius: 10px; 
    background: #fff; 
    background: -moz-linear-gradient(#fff, #999); 
    background: -webkit-linear-gradient(#fff, #999); 
    background: -o-linear-gradient(#fff, #999); 
    } 

.close { 
    background: #606061; 
    color: #FFFFFF; 
    line-height: 25px; 
    position: absolute; 
    right: -12px; 
    text-align: center; 
    top: -10px; 
    width: 24px; 
    text-decoration: none; 
    font-weight: bold; 
    -webkit-border-radius: 12px; 
    -moz-border-radius: 12px; 
    border-radius: 12px; 
    -moz-box-shadow: 1px 1px 3px #000; 
    -webkit-box-shadow: 1px 1px 3px #000; 
    box-shadow: 1px 1px 3px #000;} 
.close:hover { background: #00d9ff; 
       } 

在我的asp頁面中,我使用了錨定標記,它用於顯示彈出框:

註冊

現在的問題是:

由於這是登記表,我想現有的電子郵件ID的服務器端驗證。 如果用戶輸入的電子郵件ID已存在於數據庫中我想重新打開上面的模式對話框,並顯示錯誤消息電子郵件ID已存在。

我不能重新打開那個對話框。 有什麼辦法可以使用js來做到這一點? Plz幫助我。

的模態對話框的教程是現場: click here

對於可視化模態對話框: click here

Thanx提前。

回答

0

服務器端驗證我建議你使用JavaScript網絡方法。通過使用此Web方法彈出式窗口沒有關閉,同時頁面檢查服務器端驗證.....

0

更改:目標還接受類:

.modalDialog:target, .modalDialog.target { 
    opacity:1; 
    pointer-events: auto; 
} 

然後當你發現了電子郵件無效,你可以這樣做:

$('.modalDialog').addClass('target') 

或非jquery等價物。