When label elements are added that are appended with a colon which is often not required or is undesireable. Could we turn of the automatic colon addition for labels allowing the user to designate the entire label.
Where this is most problematic where you might wish to use say: <h3>Section Heading</h3><HR>
as a label. You end up with this:
Section Heading
---------------------------------------------------------------------------------------
:
Note the colon below the horizontal rule, it looks a bit ugly.
Alternatively, you could make the appended character (currently a colon), a settable field in the module settings so that people like me could set it to null and then we would be responsible for putting colons on all of our other field names as required. This approach would admittedly lose flexibility in subsequent reporting because all our field names would have a colon as part of the name string.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform_fieldsetmockup.png | 34.24 KB | ullgren |
Comments
Comment #1
(not verified) CreditAttribution: commentedComment #2
ullgren CreditAttribution: ullgren commentedThe colon is added by the Drupal framework as part of form_item()
I have had some ideas about fromating a label as a fieldset instead (see the mockup image).
Is this a better idea ?
Comment #3
(not verified) CreditAttribution: commentedYes,
that looks excellent, the questions are blocked with a block heading and I believe I can see one label "Questions about OS related skills".
Is this in cvs?
jnt
Comment #4
ullgren CreditAttribution: ullgren commentedThere is two labels in this form "Operating systems" and "Hardware".
The first one has it's Description field set to: "Questions about OS related skills"
This is only a mockup as in made from scratch in vi, So no code is in place yet.
This new behaviour of label would suite my needs but I just wanted to know how my users (you) work with the component. Maybe I should leave "label" as it is and add a new form component named something like "group label" ?
Comment #5
jnt CreditAttribution: jnt commentedI would vote for the two seperate label types:
This is intuitively less complicated and presumably easier to code.
I presume a 'Group Heading' would block to immediately preceeding the next 'Group Heading' or END_OF_FORM, whichever came first.
Comment #6
ullgren CreditAttribution: ullgren commentedYes that was what I had in mind.
Since the : sign after the label is added by drupals theme_form_element function.
One way to get around your the original question is to override this function in your own theme.
I don't know if there is a way to get the node type from inside this function. A quick and dirty way would be to set a global variable in your theme _page() and then check that variable in the _form_element().
Comment #7
jnt CreditAttribution: jnt commentedIt is sometimes desirable to have a block of text that can give explaination or instructions to the following section. This would be an uneditable block of text simply presented but weighted as per other components. I therefore request that the "Group Heading" as discussed in this thread be given this functionality.
The administrative user when adding a Group Heading would be given a text field to allow them to enter text as apprpriate. The text area could be left blank thus leaving the group heading (or block start) by itself
Comment #8
Marc Bijl CreditAttribution: Marc Bijl commentedHi, I was just very curious about the status of this issue.
At one of my sites, users can request (send an email) for three different packages. For each package they need to fill in different fields. Right now, I'm at the decision making of using:
- 1 form (with 3 clearly separated groups of fields)
- 3 separate forms (with required fields per form)
If I choose for the first solution, I stumble upon the same problems as jnt (isssues initiator) when customizing the look of a label. Therefore Ullgruns idea #2 looks more than excellent to me: very, very neat solution!
However, does anyone know the status of this issue? Moreover, does anyone know how I can work around this and get a solution with the look of Ullgruns image/attachment?
Looking forward to replies!
Marc
Comment #9
pepeek CreditAttribution: pepeek commentedHate to be pushy, but this feature is really a killer one ;-)
Any progres so far, or at least an est?
Comment #10
quicksketchI've been looking into how to implement this feature, though I haven't yet begun to write any code. I'm pondering how to implement the arrangement of fields into the fieldsets. Here's how I'm imagining this so far.
I guess that's it. Seems like I had more complicated plans before... Anyone that has input, please let me know.
Comment #11
ullgren CreditAttribution: ullgren commentedThats a great solution.
My original idea was to create a group/lable component and then use weight to decide when and where to break to the next lable.
Comment #12
lennart CreditAttribution: lennart commentedquicksketch, that sounds like a great solution - basically like the book outline function, where you can decide where a page should go in the hierarchy. Yo can choose a parent for the child.
Comment #13
BachusII CreditAttribution: BachusII commentedI am in need of such functionality (fieldsets) myself.
Rather than doing it completely on my own, is there some way I can be of assistence coding?
Comment #14
quicksketchDemand for this feature seems to be steadily increasing. I'm taking it up this weekend.
Comment #15
quicksketchI posted a new module to CVS today, along with new required dependent files (webform.inc, webform.install, and fieldset.inc). The CVS archive should be created shortly with the new files. I encourage anyone interested in this feature to post feedback and suggestions. Please make a backup of your database as this revision makes a change in the database schema. Of course, this change also means you'll need to run update.php after updating the module.
Comment #16
quicksketchMarking as closed. Will soon merge with 4.7 branch.