2013-08-01 62 views

Trả lời

13

này là không thể với một hệ điều hành hoặc cửa sổ trình duyệt gốc xuất hiện. Bạn sẽ phải tạo một hộp thoại lớp phủ tùy chỉnh.

Tôi khuyên bạn nên sử dụng thư viện như jQuery UI để thực hiện việc này. Sau đó, bạn có thể tùy chỉnh mọi thứ trong cửa sổ bật lên.

Bạn có thể xem một bản demo của the dialog here

4

Ngắn xây dựng của riêng bạn sử dụng phương pháp DOM và các yếu tố đầu vào: số

0

Javascript Mã

  <script> 
      $("#create-user") 
      .button() 
      .click(function() { 
      $("#dialog-form").dialog("open"); 
       }); 
      }); 
      </script> 

Mã Html:

  <div id="dialog-form" title="Create new user"> 
      <p class="validateTips">All form fields are required.</p> 
      <form> 
     <fieldset> 
     <label for="name">Name</label> 
      <input type="text" name="name" id="name" class="text"> 
      <label for="email">Email</label> 
     <input type="text" name="email" id="email" value="" class="text"> 
     <label for="password">Password</label> 
      <input type="password" name="password" id="password" value="" class="text"> 
     </fieldset> 
     </form> 
     </div> 

     <button id="create-user">Create new user</button> 
+6

này sử dụng thư viện jQuery. – zoranc