开发者

Variable number of textboxes - ASP C#

开发者 https://www.devze.com 2023-04-06 08:21 出处:网络
I have a simple dropdown list, currently using asp:ListItem to populate tho this will be changed to a db at some later point.

I have a simple dropdown list, currently using asp:ListItem to populate tho this will be changed to a db at some later point.

Depending on the users choice, I then want to present them with between 2 and 5 Lables and Textboxes so that they can enter values then run an algorythm.

The Lables and Textboxes, let call em items, will always have 1 and 2 shown, however 3-5 can be present开发者_Python百科 in any combination but preferably always in order so 5 never comes before 3 and 4 etc.

I also dont want there to be any gaps if say 3 and 4 are missing, so making them invisible isnt an option either.

Is there some form of table or listbox option than can allow me to simply do the above ? Or do I have to change the text etc for each "line" as required ?

I basically want the following (example with Lines/items 3 and 4 not required) -

  Item1          VALUE ______
  Item2          VALUE ______
  Item5          VALUE ______

Many thanks, George.


The best thing is that according to user choice make Item3 as Item5 and hide all other controls

:)


Use jQuery or basic Javascript to set the display property as none for the items that you don't want to be displayed. This way there wouldn't be any gaps on the UI for the hidden items.

0

精彩评论

暂无评论...
验证码 换一张
取 消