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 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. Link to comment https://forums.phpfreaks.com/topic/213769-signin-function-not-working/#findComment-1113144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.