Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <li class="loginlink">
- <a id="showlogin" href="#">
- <span style="color: #666666">Login</span>
- </a>
- <div class="loginbox" style="display: block;">
- <fieldset>
- <label>User Name : </label>
- <input id="input" type="text" value="" name="input">
- </fieldset>
- <label>
- <span style="display: inline-block; ...;"> Password :</span>
- </label>
- <input id="password_txt" type="password" style="padding:5px;..;"
- value="" name="password_txt">
- <p>
- <a class="loginlink" onclick="mojarra.jsfcljs(document.getElementById('headerForm'),
- {'j_idt60':'j_idt60'},'');return false" style="color: #666666;.."
- href="#">Forgot Password?
- </a>
- <a class="loginlink" onclick="mojarra.jsfcljs(document.getElementById('headerForm'),
- {'j_idt63':'j_idt63'},'');return false" style="..."
- href="#">Register
- </a>
- </p>
- <div class="loginbuttons">
- <input id="loginBtn" type="submit" value="Login" name="loginBtn">
- <input id="cancellogin" type="button" value="Cancel">
- </div>
- </div>
- </li>
- $('#showlogin').click(function(){
- var loginBox = $('.loginbox');
- loginBox.show();
- $('.loginbox fieldset input').focus();
- if (!loginBox.is(':hidden')) {
- validateUser();
- }
- });
- $('#cancellogin').click(function(){
- $('.loginbox').hide();
- });
- function validateUser() {
- $("#loginBtn").click(function(event){
- var userName = $("#input").val();
- var password = $("#password_txt").val();
- if (userName == "") {
- $.dialog({
- message: "UserName must be entered",
- imageIcon: false,
- type: "error",
- okButtonID: "ok",
- okButtonValue: "OK"
- });
- return false;
- }
- return true;
- }); //end of click
- } //end of validateUser()
- function validateUser() {
- $("#loginBtn").click(function(event){
- ...
- });
- }
- $(document).ready(function () {
- $("#loginBtn").click(function (event) {
- var userName = $("#input").val();
- var password = $("#password_txt").val();
- if (userName == "") {
- $.dialog({
- message: "UserName must be entered",
- imageIcon: false,
- type: "error",
- okButtonID: "ok",
- okButtonValue: "OK"
- });
- return false;
- }
- return true;
- });
- $('#showlogin').click(function () {
- var loginBox = $('.loginbox');
- loginBox.show();
- $('.loginbox fieldset input').focus();
- // code to call validate user removed from here!
- });
- $('#cancellogin').click(function () {
- $('.loginbox').hide();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement