views:

20

answers:

1

I am adding input elements in a view, dynamically, using JavaScript. But I am unable to find those inputs in my ActionResult's FormCollection parameter...:

public ActionResult SomeAction(FormCollection fc)

I am able to find static input elements in the View. And using FireBug, I can see that the inputs are inside of the form element, in the DOM, and are not floating around somewhere random.

How can I access these inputs elements?

+2  A: 

It is possible you're doing something to keep them from getting up to the server.

  • are you changing the form's Action on the client? This causes the form values to not be posted to the server (as a browser security precaution).
  • Remember to have a name attribute on the added elements.
  • You're really posting the form, and not just refreshing?

Are the values available in the Request object?

Patrick Karcher
The name attribute WAS missing. Didn't know that could have such horrible complications!... Thanks Patrick! :)
roosteronacid