开发者

ASP MVC Creating Form Rows Dynamically

开发者 https://www.devze.com 2022-12-27 01:49 出处:网络
I haven\'t even attempted this yet and am creating this question for advice really. I have a str开发者_如何学编程ongly typed page which receives a form model composed of several components. It is to

I haven't even attempted this yet and am creating this question for advice really.

I have a str开发者_如何学编程ongly typed page which receives a form model composed of several components. It is to create a mitigating circumstance (MC) for a student at a university for my final year project. A MC can be composed of the initial problem, assessment extensions, and I use a multi select box to allow the user to select staff retrieved from the database which are able to view the MC once created.

The thing is I feel that a student could be granted many assignment extensions for one problem. I am wander if it is possible to include a button/image on the form which when clicked will create a new assessment extension object, and duplicate the form components to set the values for the object? This would all need to occur without any page refreshes.

Any advice, or links to good tutorials would be appreciated. I have so far been unable to find any suitable examples.

Thanks,

Jon


There are a number of ways to do this, but the fastest is to create a javascript handler which creates the form controls without any sort of server request, all you need to do is keep track of how many items are in your list so you can name the form controls correctly.

Start by making a button that when you click on it creates form controls. Once you get that, work on the naming.

0

精彩评论

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

关注公众号