views:

28

answers:

3

I am on Rails. I have a form that has many text fields (about 13). It looks very bulky and smudged together. From a rails point of view, the form deals with 3 models.

I am looking for some demo links or links that intuitively deal with forms and many textfields.

Can I break the form into various different forms with next button and at the last form have a "Finish" button or something?

But how will that work? what if the user moves away in the middle?

A: 

i know of no demos for you, maybe there is a railscast that sorta deals with it, but i've never seen one that fully deals with a 13 textfield form.

Now, what i've done, is break away from REST and have what i called step_one and step_two and step_three... you get my drift.

On step one, i grab the essential info i need and i treat step_one as the CREATE method.

On step two and three, i treat them as update or PUT requests; I use update_attribute, and throw the params in there.

This did two things, lets people leave half way through if they want and breaks up the monotony of a huge form. Mind you i put all of this crud on one page, if the user gets to EDIT the model, as they did in my case.

And if the form deals with 3 models, like you say, then step one is the parent model, and the other two can be created and edited during the step_two and step_three process above, as it still applies.

pjammer
A: 

It sounds like your issue is more related to design than implementation. Designing forms can be challenging, but there are guidelines that can help to simplify the problem. One excellent overview is this slideshow, which provides many examples of forms that are simple and elegant, but which also capture many different fields.

I don't recommend splitting your form into pages -- that is confusing to the user and will make your controller overly complicated. Group the fields into related sections and break the sections with visual elements to help the user read the form. People don't mind scrolling as long as what they see is attractive and easy to read.

zetetic
A: 

Depending on your audience, it may be possible to break the form up using JavaScript - this way you preserve your models and controllers. but can collapse the form into an accordion type format, or even a wizard.

Toby Hede