Jump to content

AJAX & JQuery - Problem


havenpets

Recommended Posts

function check_form(){
httpObject.onreadystatechange = function() { 
			if(httpObject.readyState == 4){
				run_ajax(httpObject.responseText);
    				}
		}
}

function run_ajax(solution){
if(solution == 0){
$("#"+formtype).addClass('ui-state-error');
updateTips("This "+formtype+" already exists in our database.");
	return false;
}else{
	return true;
}
}

(later in coding)

function (){
			var bValid = true;
			bValid = bValid && check_form("username");
if(bValid){
alert("SUCCESS");
}

 

(I took out all the unnecessary coding. The problem lies with it not saying success even though it is! When I alert bValid before the if(), it says "undefined". Anyone know a way around this?

Link to comment
https://forums.phpfreaks.com/topic/202455-ajax-jquery-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.