I have run into another issue with the $.post call. It does not seem to be returning any information. In the below code you will see that I am passing two variables through post to a separate php file.
- $("#myform").submit(function(event){
- event.preventDefault();
- var user = document.myform.userid.value;
- var pass = document.myform.password.value;
- $.post("vallog.php",{ username: user, password: pass}, function(data){
- console.log(data.test);
- if(data.validate == "passed"){
- passed();
- }
- else{
- failed();
- }
- });
- });
The vallog.php file assigns the test value before it does anything else, so it should work. when i navigate directly to the php file it gives me the below output