Create a new div:
<divclass="Container"Id="LoginForm"Hidden> class="form-signin-heading"> User login class="Form-group"> <input type="text" class="Form-control"Id="KeyName"Placeholder="Auth Key"Name="Key"> </div> <divclass="Form-group"> <input type="Password" class="Form-control"Id="PWD"Placeholder="Auth Secret"Name="Secret"> </div> <divclass="Form-group"> <buttonclass="btn Btn-large btn-primary"Id="Btnlogin"onclick="Logincheck ()"> Sign in </button> </div></div>
The frame JS notation, can be stored in the initialization:
function Showdialoglogin () {$ ("#loginForm"). dialog ({height: -, Width: $, //Modal OpenModaltrue, //is it possible to dragDraggable:true, //Minimum widthMinWidth: -, //whether the dialog box should be closed after the user presses the ESC key, which defaults to TrueCloseonescape:true }); }
Get value Login:
function Logincheck () {varKey = $ ("#KeyName"). Val (); varSecret = $ ("#Pwd"). Val (); vardata ={key, Secret} $.ajax ({type:"Post", DataType:"JSON", URL:'/account/login', Data:data, Success:function (res) {if(Res. Message = ="Success") { $("#loginForm"). Dialog ('Close'); } Else{alert ("Please re-enter"); }}, Error:function () {alert ("Please re-enter"); }, }); };
Jquery-ui Bullet Box Login front-end notation