hello my lovely friends of daniweb commuty.
i have i jquery code of login popup basicaly it work when we click on a link to call it. but i want to excute it if a field is empty for it, i have add a code before $('a.login-window').click(function()
and that code check if the var
is empty "= null" and it excute the whole like we have click on the liink to call the popuplogin code, but it don't work here is my code please help me i don't what i made mistake
BASICALY THE CODE START FROM LINE 8 BEFORE THE LINE CODE IS THE CODE WHO I HAVE ADD AND IT IS ORIGINAL FROM JAVACRIPT AND NOT JQUERY MAYBE THERE IS THE PROBLEM??
$(document).ready(function() {
{
var client=document.forms["formulaireajout"]["client"].val;
if (client==null || client=="")
{
}
$('a.login-window').click(function() {
//Getting the variable's value from a link
var loginBox = $(this).attr('href');
//Fade in the Popup
$(loginBox).fadeIn(300);
//Set the center alignment padding + border see css style
var popMargTop = ($(loginBox).height() + 24) / 2;
var popMargLeft = ($(loginBox).width() + 24) / 2;
$(loginBox).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
// Add the mask to body
$('body').append('<div id="mask"></div>');
$('#mask').fadeIn(300);
return false;
});
// When clicking on the button close or the mask layer the popup closed
$('a.close, #mask').live('click', function() {
$('#mask , .login-popup').fadeOut(300 , function() {
$('#mask').remove();
});
return false;
});
}
});