Js double input(username,password) pop up box.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Himelchowdhury
    New Member
    • Nov 2014
    • 2

    Js double input(username,password) pop up box.

    I want to add a Js login page on my site. But with var=prompt("x", "x"); in js show only one input box in my site . I want a Js code that pop up a box that can be use as a login page.
    or give me a code that can disply two input field in this code.
    Code:
    <!DOCTYPE html>
    <html>
    <body>
    
    <p>Click the button to demonstrate the prompt box.</p>
    
    <button onclick="myFunction()">Try it</button>
    
    <p id="demo"></p>
    
    <script>
    function myFunction() {
        var person = prompt("Please enter your name", "Harry Potter");
        
        if (person != null) {
            document.getElementById("demo").innerHTML =
            "Hello " + person + "! How are you today?";
        }
    }
    </script>
    
    </body>
    </html>
    Last edited by Himelchowdhury; Nov 8 '14, 12:36 AM. Reason: Used code tag
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    kindly check out jQueryUI, this has such prompt boxes.

    Comment

    • jmrker
      New Member
      • Dec 2012
      • 17

      #3
      I'm not sure I understand the need for a library solution
      when you could create a quick and dirty solution like this...

      Code:
      <!DOCTYPE html>
      <html>
      <style type="text/css">
      #login { 
        display:none;  z-index:5;
        height:200px;  width:300px;
        position:absolute; top:200px;  left:300px; 
      }
      </style>
      <body>
           
      <p>Click the button to demonstrate the prompt box.</p>
           
      <button onclick="myFunction()">Try it</button>
      
      <div id="login">
      Login: <input type="text" id="loginName" value=""><p>
      Password: <input type="password" id="loginPswd" value=""><p>
      <button onclick="Submit()">Submit</button>
      <button onclick="Cancel()">Cancel</button>
      </div>
      
      <p id="demo"></p>
           
      <script>
      function myFunction() {
        document.getElementById('loginName').value = '';
        document.getElementById('loginPswd').value = '';
        document.getElementById('login').style.display = 'block';
      }
      function Submit() {
        document.getElementById('login').style.display = 'none';
        alert('Checks of login information performed here');
      }
      function Cancel() {
        document.getElementById('loginName').value = '';
        document.getElementById('loginPswd').value = '';
        document.getElementById('login').style.display = 'none';
      }
      </script>
           
      </body>
      </html>

      Comment

      • Exequiel
        Contributor
        • Jul 2012
        • 288

        #4
        You can try this code.
        Code:
        <!DOCTYPE html>
        <html>
        <title>Zick Login Sample</title>
        <head>
        <style>
        html, body{padding:0px; margin:0px;}
        #loginBG{
        	background:rgba(1,1,1,0.3);
        	height:100%;
        	width:100%;
        	position:fixed;
        	float:none;
        	z-index:1;
        	top:0;
        	font-family:Arial, Helvetica, sans-serif;
        }
        .loginwrapper{
        	background:#FFF;
        	padding:10px;
        	margin: 0px auto;
        	width: 400px;
        	margin-top:20px;
        	border-radius:5px;
        	box-shadow:0px 2px 2px rgba(1,1,1,0.4);
        }
        .fieldset{
        	padding:20px;	
        	border-radius:5px;
        	border:1px solid #333;
        }
        .fieldset legend{font-weight:bold; padding: 5px;}
        .fieldset table{paddng:0px; margin:0px; margin-bottom:10px; width:100%;}
        .fieldset table tr td{
        	font-weight:bold;
        	padding:0px;
        }
        .close {
          float: right;
          font-size: 20px;
          font-weight: bold;
          line-height: 20px;
          color: #000000;
          text-shadow: 0 1px 0 #ffffff;
          opacity: 0.2;
          filter: alpha(opacity=20);
        }
        .close:hover,
        .close:focus {
          color: #000000;
          text-decoration: none;
          cursor: pointer;
          opacity: 0.4;
          filter: alpha(opacity=40);
        }
        button.close {
          padding: 0;
          cursor: pointer;
          background: transparent;
          border: 0;
          -webkit-appearance: none;
        }
        .btn {
          display: inline-block;
          *display: inline;
          padding: 4px 12px;
          margin-bottom: 0;
          *margin-left: .3em;
          font-size: 14px;
          line-height: 20px;
          color: #333333;
          text-align: center;
          text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
          vertical-align: middle;
          cursor: pointer;
          background-color: #f5f5f5;
          *background-color: #e6e6e6;
          background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
          background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
          background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
          background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
          background-repeat: repeat-x;
          border: 1px solid #cccccc;
          *border: 0;
          border-color: #e6e6e6 #e6e6e6 #bfbfbf;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          border-bottom-color: #b3b3b3;
          -webkit-border-radius: 4px;
             -moz-border-radius: 4px;
                  border-radius: 4px;
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          *zoom: 1;
          -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
             -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
                  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        .btn:hover,
        .btn:focus,
        .btn:active,
        .btn.active,
        .btn.disabled,
        .btn[disabled] {
          color: #333333;
          background-color: #e6e6e6;
          *background-color: #d9d9d9;
        }
        .btn:active,
        .btn.active {
          background-color: #cccccc \9;
        }
        .btn:first-child {
          *margin-left: 0;
        }
        .btn:hover,
        .btn:focus {
          color: #333333;
          text-decoration: none;
          background-position: 0 -15px;
          -webkit-transition: background-position 0.1s linear;
             -moz-transition: background-position 0.1s linear;
               -o-transition: background-position 0.1s linear;
                  transition: background-position 0.1s linear;
        }
        .btn:focus {
          outline: thin dotted #333;
          outline: 5px auto -webkit-focus-ring-color;
          outline-offset: -2px;
        }
        .btn.active,
        .btn:active {
          background-image: none;
          outline: 0;
          -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
             -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
                  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        .btn-primary.active,
        .btn-warning.active,
        .btn-danger.active,
        .btn-success.active,
        .btn-info.active,
        .btn-inverse.active {
          color: rgba(255, 255, 255, 0.75);
        }
        .btn-primary {
          color: #ffffff;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
          background-color: #006dcc;
          *background-color: #0044cc;
          background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
          background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
          background-image: -o-linear-gradient(top, #0088cc, #0044cc);
          background-image: linear-gradient(to bottom, #0088cc, #0044cc);
          background-repeat: repeat-x;
          border-color: #0044cc #0044cc #002a80;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
        }
        .btn-primary:hover,
        .btn-primary:focus,
        .btn-primary:active,
        .btn-primary.active,
        .btn-primary.disabled,
        .btn-primary[disabled] {
          color: #ffffff;
          background-color: #0044cc;
          *background-color: #003bb3;
        }
        .btn-primary:active,
        .btn-primary.active {
          background-color: #003399 \9;
        }
        .btn-warning {
          color: #ffffff;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
          background-color: #faa732;
          *background-color: #f89406;
          background-image: -moz-linear-gradient(top, #fbb450, #f89406);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
          background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
          background-image: -o-linear-gradient(top, #fbb450, #f89406);
          background-image: linear-gradient(to bottom, #fbb450, #f89406);
          background-repeat: repeat-x;
          border-color: #f89406 #f89406 #ad6704;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
        }
        .btn-warning:hover,
        .btn-warning:focus,
        .btn-warning:active,
        .btn-warning.active,
        .btn-warning.disabled,
        .btn-warning[disabled] {
          color: #ffffff;
          background-color: #f89406;
          *background-color: #df8505;
        }
        .btn-warning:active,
        .btn-warning.active {
          background-color: #c67605 \9;
        }
        .btn-danger {
          color: #ffffff;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
          background-color: #da4f49;
          *background-color: #bd362f;
          background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
          background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
          background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
          background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
          background-repeat: repeat-x;
          border-color: #bd362f #bd362f #802420;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
        }
        .btn-danger:hover,
        .btn-danger:focus,
        .btn-danger:active,
        .btn-danger.active,
        .btn-danger.disabled,
        .btn-danger[disabled] {
          color: #ffffff;
          background-color: #bd362f;
          *background-color: #a9302a;
        }
        .btn-danger:active,
        .btn-danger.active {
          background-color: #942a25 \9;
        }
        .btn-success {
          color: #ffffff;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
          background-color: #5bb75b;
          *background-color: #51a351;
          background-image: -moz-linear-gradient(top, #62c462, #51a351);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
          background-image: -webkit-linear-gradient(top, #62c462, #51a351);
          background-image: -o-linear-gradient(top, #62c462, #51a351);
          background-image: linear-gradient(to bottom, #62c462, #51a351);
          background-repeat: repeat-x;
          border-color: #51a351 #51a351 #387038;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
        }
        .btn-success:hover,
        .btn-success:focus,
        .btn-success:active,
        .btn-success.active,
        .btn-success.disabled,
        .btn-success[disabled] {
          color: #ffffff;
          background-color: #51a351;
          *background-color: #499249;
        }
        .btn-success:active,
        .btn-success.active {
          background-color: #408140 \9;
        }
        .btn-info {
          color: #ffffff;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
          background-color: #49afcd;
          *background-color: #2f96b4;
          background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
          background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
          background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
          background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
          background-repeat: repeat-x;
          border-color: #2f96b4 #2f96b4 #1f6377;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
        }
        .btn-info:hover,
        .btn-info:focus,
        .btn-info:active,
        .btn-info.active,
        .btn-info.disabled,
        .btn-info[disabled] {
          color: #ffffff;
          background-color: #2f96b4;
          *background-color: #2a85a0;
        }
        .btn-info:active,
        .btn-info.active {
          background-color: #24748c \9;
        }
        .btn-inverse {
          color: #ffffff;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
          background-color: #363636;
          *background-color: #222222;
          background-image: -moz-linear-gradient(top, #444444, #222222);
          background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
          background-image: -webkit-linear-gradient(top, #444444, #222222);
          background-image: -o-linear-gradient(top, #444444, #222222);
          background-image: linear-gradient(to bottom, #444444, #222222);
          background-repeat: repeat-x;
          border-color: #222222 #222222 #000000;
          border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
          filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
          filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
        }
        .btn-inverse:hover,
        .btn-inverse:focus,
        .btn-inverse:active,
        .btn-inverse.active,
        .btn-inverse.disabled,
        .btn-inverse[disabled] {
          color: #ffffff;
          background-color: #222222;
          *background-color: #151515;
        }
        .btn-inverse:active,
        .btn-inverse.active {
          background-color: #080808 \9;
        }
        button.btn,
        input[type="submit"].btn {
          *padding-top: 3px;
          *padding-bottom: 3px;
        }
        button.btn::-moz-focus-inner,
        input[type="submit"].btn::-moz-focus-inner {
          padding: 0;
          border: 0;
        }
        button.btn.btn-large,
        input[type="submit"].btn.btn-large {
          *padding-top: 7px;
          *padding-bottom: 7px;
        }
        button.btn.btn-small,
        input[type="submit"].btn.btn-small {
          *padding-top: 3px;
          *padding-bottom: 3px;
        }
        button.btn.btn-mini,
        input[type="submit"].btn.btn-mini {
          *padding-top: 1px;
          *padding-bottom: 1px;
        }
        input[type="text"],
        input[type="password"]{
        	display: inline-block;
          height: 20px;
          padding: 4px 6px;
          margin-bottom: 10px;
          font-size: 14px;
          line-height: 20px;
          color: #555555;
          vertical-align: middle;
          -webkit-border-radius: 4px;
             -moz-border-radius: 4px;
                  border-radius: 4px;
        }
        input[type="text"],
        input[type="password"]{
        	 background-color: #ffffff;
          border: 1px solid #cccccc;
          -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
             -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
                  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
          -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
             -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
               -o-transition: border linear 0.2s, box-shadow linear 0.2s;
                  transition: border linear 0.2s, box-shadow linear 0.2s;
        }
        input[type="text"]:focus,
        input[type="password"]:focus{
        	border-color: rgba(82, 168, 236, 0.8);
        	outline: 0;
        	outline: thin dotted \9;
        	/* IE6-9 */
        	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
        	 -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
        		  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
        }
        .fullwidth{
        	width:100%;
        }
        </style>
        <script>
        function Login() 
        {
        	var usrnm = document.getElementById("usrnm").value;
        	var pwd = document.getElementById("pwd").value;
        	
        	if(usrnm != "" && pwd != "")
        	{
        		document.getElementById("demo").innerHTML = "Hello " + usrnm + "! How are you today? <br> Your password is "+pwd;
        		closemodal();//close the login modal
        	}
        }
        function showmodal(){
        	document.getElementById("loginBG").style.display="block";
        }
        function closemodal(){
        	document.getElementById("loginBG").style.display="none";
        }
        </script>
        </head>
        <body>
        
        <p>Click the button to demonstrate the prompt box.</p>
        <button onclick="showmodal()">Try it</button>
        <div id="demo"></div>
        
        <div id="loginBG" style="display:none;">
            <div id="loginwrapper" class="loginwrapper">
            	<div align="right" style="float:right;margin-right:7px; margin-bottom:6px; margin-top:-2px;">
                	<button type="button" class="close" onclick="closemodal()" style="position:absolute;" title="Close">
                    	<span aria-hidden="true">&times;</span>
                    </button>
                </div>
                 <div style="clear:both; padding:0px;"></div>
            	<fieldset class="fieldset">
                	<legend>LOGIN</legend>
                        <form method="post" action="javascript:;">
                            <table>
                                <tr>
                                    <td style="width:1%;">Username:&nbsp;</td>
                                    <td>
                                        <input type="text" id="usrnm" style="width:95%;">
                                    </td>
                                </tr>
                                <tr>
                                    <td>Password:&nbsp;</td>
                                    <td>
                                        <input type="password" id="pwd" style="width:95%;">
                                    </td>
                                </tr>
                            </table>
                            <input type="submit" id="login" value="Login" class="btn btn-primary fullwidth" onClick="Login()">
                        </form>
            	</fieldset>
            </div>
        </div>
        </body>
        </html>

        Comment

        • Exequiel
          Contributor
          • Jul 2012
          • 288

          #5
          You can try this code.
          Code:
          <!DOCTYPE html>
          <html>
          <title>Zick Login Sample</title>
          <head>
          <style>
          html, body{padding:0px; margin:0px;}
          #loginBG{
          	background:rgba(1,1,1,0.3);
          	height:100%;
          	width:100%;
          	position:fixed;
          	float:none;
          	z-index:1;
          	top:0;
          	font-family:Arial, Helvetica, sans-serif;
          }
          .loginwrapper{
          	background:#FFF;
          	padding:10px;
          	margin: 0px auto;
          	width: 400px;
          	margin-top:20px;
          	border-radius:5px;
          	box-shadow:0px 2px 2px rgba(1,1,1,0.4);
          }
          .fieldset{
          	padding:20px;	
          	border-radius:5px;
          	border:1px solid #333;
          }
          .fieldset legend{font-weight:bold; padding: 5px;}
          .fieldset table{paddng:0px; margin:0px; margin-bottom:10px; width:100%;}
          .fieldset table tr td{
          	font-weight:bold;
          	padding:0px;
          }
          .close {
            float: right;
            font-size: 20px;
            font-weight: bold;
            line-height: 20px;
            color: #000000;
            text-shadow: 0 1px 0 #ffffff;
            opacity: 0.2;
            filter: alpha(opacity=20);
          }
          .close:hover,
          .close:focus {
            color: #000000;
            text-decoration: none;
            cursor: pointer;
            opacity: 0.4;
            filter: alpha(opacity=40);
          }
          button.close {
            padding: 0;
            cursor: pointer;
            background: transparent;
            border: 0;
            -webkit-appearance: none;
          }
          .btn {
            display: inline-block;
            *display: inline;
            padding: 4px 12px;
            margin-bottom: 0;
            *margin-left: .3em;
            font-size: 14px;
            line-height: 20px;
            color: #333333;
            text-align: center;
            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
            vertical-align: middle;
            cursor: pointer;
            background-color: #f5f5f5;
            *background-color: #e6e6e6;
            background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
            background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
            background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
            background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
            background-repeat: repeat-x;
            border: 1px solid #cccccc;
            *border: 0;
            border-color: #e6e6e6 #e6e6e6 #bfbfbf;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            border-bottom-color: #b3b3b3;
            -webkit-border-radius: 4px;
               -moz-border-radius: 4px;
                    border-radius: 4px;
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
            *zoom: 1;
            -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
               -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
                    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
          }
          .btn:hover,
          .btn:focus,
          .btn:active,
          .btn.active,
          .btn.disabled,
          .btn[disabled] {
            color: #333333;
            background-color: #e6e6e6;
            *background-color: #d9d9d9;
          }
          .btn:active,
          .btn.active {
            background-color: #cccccc \9;
          }
          .btn:first-child {
            *margin-left: 0;
          }
          .btn:hover,
          .btn:focus {
            color: #333333;
            text-decoration: none;
            background-position: 0 -15px;
            -webkit-transition: background-position 0.1s linear;
               -moz-transition: background-position 0.1s linear;
                 -o-transition: background-position 0.1s linear;
                    transition: background-position 0.1s linear;
          }
          .btn:focus {
            outline: thin dotted #333;
            outline: 5px auto -webkit-focus-ring-color;
            outline-offset: -2px;
          }
          .btn.active,
          .btn:active {
            background-image: none;
            outline: 0;
            -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
               -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
                    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
          }
          .btn-primary.active,
          .btn-warning.active,
          .btn-danger.active,
          .btn-success.active,
          .btn-info.active,
          .btn-inverse.active {
            color: rgba(255, 255, 255, 0.75);
          }
          .btn-primary {
            color: #ffffff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
            background-color: #006dcc;
            *background-color: #0044cc;
            background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
            background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
            background-image: -o-linear-gradient(top, #0088cc, #0044cc);
            background-image: linear-gradient(to bottom, #0088cc, #0044cc);
            background-repeat: repeat-x;
            border-color: #0044cc #0044cc #002a80;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          }
          .btn-primary:hover,
          .btn-primary:focus,
          .btn-primary:active,
          .btn-primary.active,
          .btn-primary.disabled,
          .btn-primary[disabled] {
            color: #ffffff;
            background-color: #0044cc;
            *background-color: #003bb3;
          }
          .btn-primary:active,
          .btn-primary.active {
            background-color: #003399 \9;
          }
          .btn-warning {
            color: #ffffff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
            background-color: #faa732;
            *background-color: #f89406;
            background-image: -moz-linear-gradient(top, #fbb450, #f89406);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
            background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
            background-image: -o-linear-gradient(top, #fbb450, #f89406);
            background-image: linear-gradient(to bottom, #fbb450, #f89406);
            background-repeat: repeat-x;
            border-color: #f89406 #f89406 #ad6704;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          }
          .btn-warning:hover,
          .btn-warning:focus,
          .btn-warning:active,
          .btn-warning.active,
          .btn-warning.disabled,
          .btn-warning[disabled] {
            color: #ffffff;
            background-color: #f89406;
            *background-color: #df8505;
          }
          .btn-warning:active,
          .btn-warning.active {
            background-color: #c67605 \9;
          }
          .btn-danger {
            color: #ffffff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
            background-color: #da4f49;
            *background-color: #bd362f;
            background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
            background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
            background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
            background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
            background-repeat: repeat-x;
            border-color: #bd362f #bd362f #802420;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          }
          .btn-danger:hover,
          .btn-danger:focus,
          .btn-danger:active,
          .btn-danger.active,
          .btn-danger.disabled,
          .btn-danger[disabled] {
            color: #ffffff;
            background-color: #bd362f;
            *background-color: #a9302a;
          }
          .btn-danger:active,
          .btn-danger.active {
            background-color: #942a25 \9;
          }
          .btn-success {
            color: #ffffff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
            background-color: #5bb75b;
            *background-color: #51a351;
            background-image: -moz-linear-gradient(top, #62c462, #51a351);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
            background-image: -webkit-linear-gradient(top, #62c462, #51a351);
            background-image: -o-linear-gradient(top, #62c462, #51a351);
            background-image: linear-gradient(to bottom, #62c462, #51a351);
            background-repeat: repeat-x;
            border-color: #51a351 #51a351 #387038;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          }
          .btn-success:hover,
          .btn-success:focus,
          .btn-success:active,
          .btn-success.active,
          .btn-success.disabled,
          .btn-success[disabled] {
            color: #ffffff;
            background-color: #51a351;
            *background-color: #499249;
          }
          .btn-success:active,
          .btn-success.active {
            background-color: #408140 \9;
          }
          .btn-info {
            color: #ffffff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
            background-color: #49afcd;
            *background-color: #2f96b4;
            background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
            background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
            background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
            background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
            background-repeat: repeat-x;
            border-color: #2f96b4 #2f96b4 #1f6377;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          }
          .btn-info:hover,
          .btn-info:focus,
          .btn-info:active,
          .btn-info.active,
          .btn-info.disabled,
          .btn-info[disabled] {
            color: #ffffff;
            background-color: #2f96b4;
            *background-color: #2a85a0;
          }
          .btn-info:active,
          .btn-info.active {
            background-color: #24748c \9;
          }
          .btn-inverse {
            color: #ffffff;
            text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
            background-color: #363636;
            *background-color: #222222;
            background-image: -moz-linear-gradient(top, #444444, #222222);
            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
            background-image: -webkit-linear-gradient(top, #444444, #222222);
            background-image: -o-linear-gradient(top, #444444, #222222);
            background-image: linear-gradient(to bottom, #444444, #222222);
            background-repeat: repeat-x;
            border-color: #222222 #222222 #000000;
            border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
          }
          .btn-inverse:hover,
          .btn-inverse:focus,
          .btn-inverse:active,
          .btn-inverse.active,
          .btn-inverse.disabled,
          .btn-inverse[disabled] {
            color: #ffffff;
            background-color: #222222;
            *background-color: #151515;
          }
          .btn-inverse:active,
          .btn-inverse.active {
            background-color: #080808 \9;
          }
          button.btn,
          input[type="submit"].btn {
            *padding-top: 3px;
            *padding-bottom: 3px;
          }
          button.btn::-moz-focus-inner,
          input[type="submit"].btn::-moz-focus-inner {
            padding: 0;
            border: 0;
          }
          button.btn.btn-large,
          input[type="submit"].btn.btn-large {
            *padding-top: 7px;
            *padding-bottom: 7px;
          }
          button.btn.btn-small,
          input[type="submit"].btn.btn-small {
            *padding-top: 3px;
            *padding-bottom: 3px;
          }
          button.btn.btn-mini,
          input[type="submit"].btn.btn-mini {
            *padding-top: 1px;
            *padding-bottom: 1px;
          }
          input[type="text"],
          input[type="password"]{
          	display: inline-block;
            height: 20px;
            padding: 4px 6px;
            margin-bottom: 10px;
            font-size: 14px;
            line-height: 20px;
            color: #555555;
            vertical-align: middle;
            -webkit-border-radius: 4px;
               -moz-border-radius: 4px;
                    border-radius: 4px;
          }
          input[type="text"],
          input[type="password"]{
          	 background-color: #ffffff;
            border: 1px solid #cccccc;
            -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
               -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
                    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
            -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
               -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
                 -o-transition: border linear 0.2s, box-shadow linear 0.2s;
                    transition: border linear 0.2s, box-shadow linear 0.2s;
          }
          input[type="text"]:focus,
          input[type="password"]:focus{
          	border-color: rgba(82, 168, 236, 0.8);
          	outline: 0;
          	outline: thin dotted \9;
          	/* IE6-9 */
          	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
          	 -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
          		  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
          }
          .fullwidth{
          	width:100%;
          }
          </style>
          <script>
          function Login() 
          {
          	var usrnm = document.getElementById("usrnm").value;
          	var pwd = document.getElementById("pwd").value;
          	
          	if(usrnm != "" && pwd != "")
          	{
          		document.getElementById("demo").innerHTML = "Hello " + usrnm + "! How are you today? <br> Your password is "+pwd;
          		closemodal();//close the login modal
          	}
          }
          function showmodal(){
          	document.getElementById("loginBG").style.display="block";
          }
          function closemodal(){
          	document.getElementById("loginBG").style.display="none";
          }
          </script>
          </head>
          <body>
          
          <p>Click the button to demonstrate the prompt box.</p>
          <button onclick="showmodal()">Try it</button>
          <div id="demo"></div>
          
          <div id="loginBG" style="display:none;">
              <div id="loginwrapper" class="loginwrapper">
              	<div align="right" style="float:right;margin-right:7px; margin-bottom:6px; margin-top:-2px;">
                  	<button type="button" class="close" onclick="closemodal()" style="position:absolute;" title="Close">
                      	<span aria-hidden="true">&times;</span>
                      </button>
                  </div>
                   <div style="clear:both; padding:0px;"></div>
              	<fieldset class="fieldset">
                  	<legend>LOGIN</legend>
                          <form method="post" action="javascript:;">
                              <table>
                                  <tr>
                                      <td style="width:1%;">Username:&nbsp;</td>
                                      <td>
                                          <input type="text" id="usrnm" style="width:95%;">
                                      </td>
                                  </tr>
                                  <tr>
                                      <td>Password:&nbsp;</td>
                                      <td>
                                          <input type="password" id="pwd" style="width:95%;">
                                      </td>
                                  </tr>
                              </table>
                              <input type="submit" id="login" value="Login" class="btn btn-primary fullwidth" onClick="Login()">
                          </form>
              	</fieldset>
              </div>
          </div>
          </body>
          </html>

          Comment

          Working...