McBryver Posted September 18, 2010 Share Posted September 18, 2010 Im not sure whats wrong: function signin(){ document.getElementById("login_error").innerHTML = "<img src='images/loading.gif' />"; var user = document.getElementById("username_client").value; var pass = document.getElementById("password").value; if(user=null){ document.getElementById("login_error").innerHTML = "You must enter a valid username!<br />"; return "err"; }else{ document.getElementById("login_error").innerHTML = "Username Good!<br />"; } if(pass=null){ document.getElementById("login_error").innerHTML = "You must enter a valid password!<br />"; }else{ document.getElementById("login_error").innerHTML = "Password Good!<br />"; } } function call code: <p><div class="button"><a href='javascript:signin();' style='cursor: pointer;'>Sign In!</a></div></p> Error Console in Firefox Displays no Errors However Nothing is happening any help would be cool! Bryver Quote Link to comment https://forums.phpfreaks.com/topic/213769-signin-function-not-working/ Share on other sites More sharing options...
Adam Posted September 20, 2010 Share Posted September 20, 2010 How did you solve this? I'm not sure if you know but "=" in JavaScript means 'takes the value of', "==" means 'equal to'. Unless this is fixed your IF expressions won't evaluate the way you think. Quote Link to comment https://forums.phpfreaks.com/topic/213769-signin-function-not-working/#findComment-1113144 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.