abalter
abalter

Reputation: 10393

CFWheels form helpers vs HTML forms

CFWheels has form helpers, and cfwheels.org tries to convince me that they are better and easier to use. In the interest of being self-consistent, I would like to use them. But I'm finding that the lack of id attributes is making them difficult to style. For instance, because form helpers don't support the id tag, I can't choose when to make them visible or not, apply background images, or basically anything else I want to do with CSS. The control helpers do let you prepend and append to both the label and control with div tags if I want, but why is that easier than just surrounding them in a div -- which is unnecessary to do if I just use an HTML form. Also, that makes for unnecessarily messy rendered html.

A simple answer is "just use what works best for you." But I'm wondering if there is a good reason why I SHOULD use the form helpers, and what to do about all the styling limitations? Why the heck not just support id tags like "id" and "label-id"!

Upvotes: 0

Views: 229

Answers (1)

Tushar Bhaware
Tushar Bhaware

Reputation: 2525


CfWheels form helpers are better. You will learn why as you try to use it in your code. And for your information, it does support id attribute, in fact, it supports all html attributes for particular element.
Check out the text field tag

for example. It clearly states that Note: Pass any additional arguments like class, rel, and id, and the generated tag will also include those values as HTML attributes. So you can style them, hide them, do whatever you want to do with them using CSS, javascript, jquery.
i seriously recommend you to watch screencasts

Upvotes: 6

Related Questions