jQuery(document).ready(function($){ function lp_login() { $("#lp_loading_image").show(); var log = $("#log").val(); var pwd = $("#pwd").val(); var rem = ( $("#rememberme").attr('checked') ) ? $("#rememberme").val() : ''; /* if( log == '' ) alert(log + ' | ' + pwd + ' | ' + rem); if( pwd == '' ) alert(log + ' | ' + pwd + ' | ' + rem); */ $.post("http://lisehowe.com/wp-content/plugins/listingpress/users/lp_user_login.php",{ action: 'lp_login', log: log, pwd: pwd, rememberme: rem }, function(data){ $("#lp_user_ajax_container").empty().html(data); }); } function lp_register() { alert('You clicked return'); } function lp_lost_password() { alert('You clicked return'); } $("#lp_login_submit").click(lp_login); $("#lp_register_submit").click(lp_register); $("#lp_login_form input").keypress(function(e){ var code = (e.keyCode ? e.keyCode : e.which); if(code == 13) lp_login(); }); $("#lp_register_form input").keypress(function(e){ var code = (e.keyCode ? e.keyCode : e.which); if(code == 13) lp_register(); }); $("#lp_lost_password_form input").keypress(function(e){ var code = (e.keyCode ? e.keyCode : e.which); if(code == 13) lp_lost_password(); }); $(".change_login_view").click(function(){ var show = $(this).attr('id'); $(".lp_user_form").hide(); $("#" + show + "_form").show(); }); $(".lp_bookmark_listing").click(function(){ // Issue a message to the consumer that they need to be logged in to bookmark a listing }); });