Click to See Complete Forum and Search --> : hi , just a wonder


to know
06-26-2003, 11:57 AM
what is validFlag, im unsure of what its function is or what it does in the code.

thanks

to know
06-26-2003, 12:03 PM
this is a continuation of the previous thread...this is the actual code, but it doesnt seem to work, the code is fixed on a delphi programme............
function checkFields(PEPSection_A_Form)
{
var num = PEPSection_A_Form.elements.length;
var validFlag = True;
for (var i=0; i<num; i++){

if ((PEPSection_A_Form.elements[i].value == "") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD") &&
(typeof PEPSection_A_Form.elements[i] == "FIELD"))
{
validFlag = False;
}
}
if (validFlag == False) {
alert("The field is blank, please fill the required \nfields for this form to be processed.")
}else{
alert("This is a blank record.")
}
return validFlag
}

petermar30030
06-26-2003, 12:04 PM
Not Sure If I Ever Heard Of That Command, Were Did You Here About It?

pyro
06-26-2003, 12:05 PM
I've never heard of it. I would think it is a custom function/variable. If you post you code, I can tell you for sure.

pyro
06-26-2003, 12:09 PM
I merged the threads together...no need to start new threads on the same topic.

validFlag is just a variable. It is origianally set to True, and if certain conditions are met, it is set to False. It is then used later to popup and alert depending on if it is true or false.

to know
06-26-2003, 12:14 PM
but how comes then when i run the code with the event handler set on the scrip event of the component it does not work especially when i move off the form 'save(button)' this is my function 'checkFields(this);'..........


thanks for responding tho...:)