Hello, my problem is as follows. I have a system to create accounts. However, different users can set different attributes to the created account. That means I get a dynamic form with different attributes for different users. My question is how should I process such a form?
A:
Looks like that you need hide/show some html elements based on the user selection, take a look at JQuery to manipulate form element on the client side.
J.W.
2009-05-06 12:59:54
That doesnt sound bad, however, I get the list of allowed attributes from a web service and by time the number of attributes increases and I dont want to compile every timea new action with these additional attribues. Anyway I'll give it a try, thanks.
Trimack
2009-05-06 13:07:11
A:
Once you have the client side sorted out with Jquery then you probably want to process the form values based on whether there is an entry of any kind, look to use the following on the controller to get the entire form collection:
public ActionResult AddUser(FormCollection formvals)
{
//Check for existence of form values and save as appropriate
return View();
}
Richard
2009-05-06 13:05:25