tags:

views:

74

answers:

2

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.
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
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
Thats it, thanks.
Trimack