Hi, I have a list of variables in a form that are in a consecutive list, such as date1, date2, date3, and so on, which has the length determined from an sql query. Now, my question is, how would I validate that the fields are filled? I'm not very good at javascript, and the script I have looks like (and this is just to get the values for the variables, if I can do that I know how to validate it from there):
function checkForm(form,x)
{
for(i=1;i<=x;i++)
{
var date1="document.forms.enterNew.cDate"+i+".value";
alert(date1);
}
return false;
}
the alert gives me the actual string 'document.forms.enterNew.cDate1.value' and so on instead of what the actual value is. I have x = query.recordcount so it runs the loop as many times as there are entries, that part does work. Am I at least on the semi right track, or am I going about this completely wrong? I'm sure I left a lot that is needed out, so please pardon my newbieness.
function checkForm(form,x)
{
for(i=1;i<=x;i++)
{
var date1="document.forms.enterNew.cDate"+i+".value";
alert(date1);
}
return false;
}
the alert gives me the actual string 'document.forms.enterNew.cDate1.value' and so on instead of what the actual value is. I have x = query.recordcount so it runs the loop as many times as there are entries, that part does work. Am I at least on the semi right track, or am I going about this completely wrong? I'm sure I left a lot that is needed out, so please pardon my newbieness.