Question subject: [Ajax/PHP] Registration - Check for empty textboxs
Posted: Sun Dec 25, 2011 4:23 pm
Joined: Sun Dec 25, 2011 4:19 pm Posts: 1 Has thanked: 0 time Have thanks: 0 time
Hi,
I'm doing a registration system and as you can see when i verify the fields, if it's empty it says that the FIELD_1 misses. And what i want is if the field is empty says that and then goes back, but i don't wanto the info already written disappears.
I'm using ajax, i never worked with it, so i'm gonna ask you if i'm doing everything ok:
var AJAXForms = false; var LastField = null; var isIE = false; // on !IE we only have to initialize it once if (window.XMLHttpRequest) { AJAXForms = new XMLHttpRequest(); }
function CheckField(field) {
if (window.XMLHttpRequest) { // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { AJAXForms = new ActiveXObject("Microsoft.XMLHTTP"); }