Hi all!
I’m trying to write a validateAdd function that I would like to use like this:
myForm = new dhtmlXForm("myForm", formData);
myForm.attachEvent("onButtonClick", function(name) {
if (name == "send") {
if (validateAdd() == true) {
myForm.send("php/save_data.php","post",function(xml){
alert("Saved!");
myForm.reset();
});
}
}
});
The validateAdd function looks like this:
function validateAdd(){
if(document.('ComboX').value == ''){
alert("ComboX empty!");
return false;
}
return true;
}
Obviously (document.(‘ComboX’).value == ‘’) is not the right syntax… Could you please show me the right syntax to access the combo from here?
And one last question: is there a way to pass to “php/save_data.php” (which saves my data in a database) the TextValue of the combo instead of its index?
Thanks in advance for your suggestions!!
Marco
Ps. I’m sorry if maybe this is not posted in the correct section of your forum… I was very undecided where to post this…