开发者

How to keep track of selections in sequential form

I have what is essentially a form, only the fields depend on the previous selections, and the type of form object aren't always typical form objects.

For example, the first choices are simply in the form of links. It could be a list of teachers, where when you selec开发者_JS百科t a teachers name, the classes that teacher teaches is then displayed in a drop-down list. Then once a class is selected, the available dates and time are displayed in a calendar. Once a date/time is selected I need to know all of the selections that were made -- the teacher, the class, and the date and time.

How would you recommend keeping track of these selections? I'm using ajax, and although the form fields are hidden at times, i can still access their values. The one exception is the teacher selection. Since it's just a link, I pass the selected value to a method, but then I've lost the selection. I could store the selection in a hidden field, but is that really the best solution?

Thanks!


I would use a session store on a controller action. Then once it's complete extract all the gathered information.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜