WolfShade
09-22-2003, 10:32 PM
Can it be done?
What I have is a form that is currently static; it will eventually be dynamically generated with tabs that can be anywhere from 1 to 100 tabs, using <DIV id="contentblockx"> surrounding tables that will provide different fields depending upon what tab is clicked. Since the number of tabs will be dynamic, I need to create dynamic form validation.
In normal validation, I create a variable called warn and set it to equal "", then if anything erroneous happens, warn += "blah blah blah"; if warn !="" then alert(warn) else return true.
I'd like to have as many warn variables as there are tabs (warn1 through warn[x]). Unfortunately, I can't figure out how to establish a warn[x] in the for loop.
for (a=1; a<numberOfTabs+1; a++) {
warn[a]="";
-= validation stuff goes here =-
}
.. isn't working. Even putting it within an eval() didn't do it. Any suggestions? I've been searching a lot and have not yet found anyone else asking this question (yet), nor any kind of tutorial on how to do it. Any suggestions?
Thank you for your time.
What I have is a form that is currently static; it will eventually be dynamically generated with tabs that can be anywhere from 1 to 100 tabs, using <DIV id="contentblockx"> surrounding tables that will provide different fields depending upon what tab is clicked. Since the number of tabs will be dynamic, I need to create dynamic form validation.
In normal validation, I create a variable called warn and set it to equal "", then if anything erroneous happens, warn += "blah blah blah"; if warn !="" then alert(warn) else return true.
I'd like to have as many warn variables as there are tabs (warn1 through warn[x]). Unfortunately, I can't figure out how to establish a warn[x] in the for loop.
for (a=1; a<numberOfTabs+1; a++) {
warn[a]="";
-= validation stuff goes here =-
}
.. isn't working. Even putting it within an eval() didn't do it. Any suggestions? I've been searching a lot and have not yet found anyone else asking this question (yet), nor any kind of tutorial on how to do it. Any suggestions?
Thank you for your time.