I have dynamic generated form and I store the form information in a array, like:
<INPUT ... name="data[name]">
<INPUT ... name="data[address]">
and so on. This is much more easyer do deal with data from a form. But I want to validate my form using javascript and here's the problem, in my javascript i try do something like:
if(document.form.data[name]=="") {
alert("Please enter your name.")
document.form.data[name].focus()
return false
}
But obviously Javascript says that "name" is undefined since (i guess) it thinks that data[name] is an array when actually it is the name of the textbox. Is there any solution for this problem ? If anyone have faced (and overcame) problem like this I'd appreciate help.
thx
Anderson