cactus1000
Programmer
How do I validate dynamically created fields? For example, I have a form with dynamically created drop-down lists like this (parts b and c):
<asp
ropDownList id="DOB1a" runat="server">
<asp:ListItem Value="">Month</asp:ListItem>
<asp:ListItem Value="1">Jan</asp:ListItem>
<asp:ListItem Value="2">Feb</asp:ListItem>
<asp:ListItem Value="3">Mar</asp:ListItem>
<asp:ListItem Value="4">Apr</asp:ListItem>
<asp:ListItem Value="5">May</asp:ListItem>
<asp:ListItem Value="6">Jun</asp:ListItem>
<asp:ListItem Value="7">Jul</asp:ListItem>
<asp:ListItem Value="8">Aug</asp:ListItem>
<asp:ListItem Value="9">Sept</asp:ListItem>
<asp:ListItem Value="10">Oct</asp:ListItem>
<asp:ListItem Value="11">Nov</asp:ListItem>
<asp:ListItem Value="12">Dec</asp:ListItem>
</asp
ropDownList>
<%
Dim i as Integer
for i=1 to 31
DOB1b.Items.Insert(i, new ListItem(i, i))
next
Dim j as Integer
for j=1 to 105
DOB1c.Items.Insert(j, new ListItem(2005-j, 2005-j))
next
%>
<asp:ListItem Value="">Day</asp:ListItem>
</asp
ropDownList>
<asp
ropDownList id="DOB1c" runat="server">
<asp:ListItem Value="">Year</asp:ListItem>
</asp
ropDownList>
I can't figure out any way to validate parts b and c.
Has anyone encountered this before? I also have a similar problem with validating data in tables that are user-generated.
<asp
<asp:ListItem Value="">Month</asp:ListItem>
<asp:ListItem Value="1">Jan</asp:ListItem>
<asp:ListItem Value="2">Feb</asp:ListItem>
<asp:ListItem Value="3">Mar</asp:ListItem>
<asp:ListItem Value="4">Apr</asp:ListItem>
<asp:ListItem Value="5">May</asp:ListItem>
<asp:ListItem Value="6">Jun</asp:ListItem>
<asp:ListItem Value="7">Jul</asp:ListItem>
<asp:ListItem Value="8">Aug</asp:ListItem>
<asp:ListItem Value="9">Sept</asp:ListItem>
<asp:ListItem Value="10">Oct</asp:ListItem>
<asp:ListItem Value="11">Nov</asp:ListItem>
<asp:ListItem Value="12">Dec</asp:ListItem>
</asp
<%
Dim i as Integer
for i=1 to 31
DOB1b.Items.Insert(i, new ListItem(i, i))
next
Dim j as Integer
for j=1 to 105
DOB1c.Items.Insert(j, new ListItem(2005-j, 2005-j))
next
%>
<asp:ListItem Value="">Day</asp:ListItem>
</asp
<asp
<asp:ListItem Value="">Year</asp:ListItem>
</asp
I can't figure out any way to validate parts b and c.
Has anyone encountered this before? I also have a similar problem with validating data in tables that are user-generated.