Greetings again experts,
I have another challenging task.
We have a project that allows users to dynamically add more rows if needed.
I got a working copy of this that I received help from here:
Now, we have been asked to make one important change.
Rather than click a button to add another row, we are asked to use a DropDownList to add a row dynamically.
For instance, we have a DropDownList with 5 options:
<asp:DropDownList ID="Sizes" runat="server" >
<asp:ListItem Value="">Please Select</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
Our DropDownList will be dynamically populated from the database.
We have that working already. I am posting this as sample.
When a user selects an option say 1, one row will be available for user to enter data.
If the user selects 2 from the DropDownList, rows will be dynamically added.
The maximum row can be dynamically added is 3.
In other words, even though there are 5 options on the DropDownList, once a user selects 3 options, 3 rows are dynamically added and the user cannot select from the DropDownList anymore unless s/he deletes one row first to make the DropDownList available for selection again.
I have spent almost a week thinking of a solution but completely stumped.
Is this possible?
As always, thank you so much for your help friends.