I ve got another similar script running just fine, i don t see why this isn t working. Is there anything wrong with this code?
$("#lastname").keyup(function(event){
var keyCode = event.keyCode || event.which;
if(keyCode === 13) {
passOnRegFront();
}
});
$("#register").click(function() {
passOnRegFront();
});
function passOnRegFront() {
var firstname = $("#firstname").val();
var lastname = $("#lastname").val();
var dataString = &firstname= + firstname + &lastname= + lastname;
if(email== || password== ) {
$( #success ).fadeOut(400).hide();
$( #error ).fadeOut(400).show();
} else {
$.ajax({
type: "POST",
dataType: "JSON",
url: "<?=base_url()?>index.php/home/passOnReg",
data: dataString,
json: {session_state: true},
success: function(data) {
if(data.registered == true) { // true means user is logged in.
$("#main1").hide();
$("#main1").load( <?=base_url()?>index.php/home/dashboard );
}
}
});
}
}
});