Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I validate dynamically created fields?

Status
Not open for further replies.

cactus1000

Programmer
Aug 31, 2001
149
0
0
US
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:DropDownList 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:DropDownList>
<%
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:DropDownList>


<asp:DropDownList id="DOB1c" runat="server">
<asp:ListItem Value="">Year</asp:ListItem>
</asp:DropDownList>


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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top