• I’m trying to Ajaxify a javascript error message in an existing WordPress plugin. The original code in the plugin looks like this:

    if (msg.length > 0) {
    			msg = "The following fields need to be completed before you can submit.\n\n" + msg;
    			alert(msg);
    			return false;
    		}
    
    	return true;

    This doesn’t work unfortunately:

    if (msg.length > 0) {
    			msg = "The following fields need to be completed before you can submit.\n\n" + msg;
    
    			if (xmlHttp==null)
    			{
    			alert(msg);
    			return false;
    			}  
    
    			document.getElementById("message").innerHTML = 'Please fill out all required information';
    			return false;
    		}
    
    	return true;   
    
    }

    What am I missing?

The topic ‘Ajaxify simple javascript msg’ is closed to new replies.