Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a Horizontal form with deform 2? #214

Closed
renierdbruyn opened this issue May 30, 2014 · 2 comments
Closed

How to create a Horizontal form with deform 2? #214

renierdbruyn opened this issue May 30, 2014 · 2 comments

Comments

@renierdbruyn
Copy link

I am using deform 2 together with Bootstrap 3, to render some forms, and I want to create a Horizontal form as shown here, but all of the examples on the demo-site, is not examples of horizontal forms( with the label next to the input element).

I have tried using form_class="form-horizontal", and bootstrap_form_style="form-horizontal"(deform_bootstrap). When using the above, it does add the class form-horizontal, however I dont just want to add a class to the form element.

How do I add the rest of the class names to the rest of the form to make it a horizontal form as is on the the bootstrap site?

@dairiki
Copy link
Contributor

dairiki commented May 30, 2014

You probably know this, but it's not just a matter of setting appropriate CSS classes, the HTML structure of horizontal forms is different that that of vertical forms (e.g. need an extra <div> around the text <input>.) This requires changes, I think, to (at least) the form.pt and mapping-item.pt templates.

I did some work on this in PR #187. The patches there are probably stale now.

@renierdbruyn
Copy link
Author

Thanks for your response. I have managed to modify the files: form.pt and mapping-item.pt and I got now a horizontal form 😄 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants