views:

49

answers:

1

Hi all, i need an advice on how to implement my form.
I have a requirement: i need a form that spans through 5 tabs. Each tab has around 10 fields, some of them empty, some of them must contain data from db and be non editable. Each of these tabs must be a part of one form that is submitted to my controller.

The question is: what is the best way to implement this? I was thinking about having partial views on each tab, each view would have its own model class. After form gets filled all data from all partials would go to action that will take care of all of it. Any advices?
I am using ASP.NET MVC 1, Entity Framework 1, mvc extensions from Telerik and jQuery

+1  A: 

IMHO the easy way to do this is to have one single form split up into tabs via <div>'s. Then use one of the bazillion jquery/javascript tabbing libraries to switch between them.

Validation and UI flow control will be so much simpler. A single form, single POST action method,single place for validation errors. Splitting up this problem with partials and multiple views just makes things harder.

jfar
Thanks for advice. Which jQuery Tab library would you reccomend that is lightweight and easy to learn?
Sasha
Probably the one built into JQuery UI. That way you can theme all the UI widgets and share that across your site.
jfar
There is indeed one in jQuery UI: http://jqueryui.com/demos/tabs/But like you say, if that's no good, there are tons more out there. I would also follow this approach - 1 form, several `divs` for tabs.
Rob Cooper