[support] Non intrusive form layout change in 5.X

Ivan Sergio Borgonovo mail at webthatworks.it
Mon Mar 17 13:56:01 UTC 2008


I've a list of checkboxes and a fieldtext:

default should show like:

[X] abc
[ ] def
[ ] ghi
...

[X] other

Other
[fieldtext]

It should be turned into:

[X] abc
[ ] def
[ ] ghi
...

[X] other [fieldtext]


I do know that the checkbox and the textfield are redundant... but
well that's what I've to obtain.


Generated HTML looks like:
<div class="form-item">
<label>Label </label>
<div class="form-checkboxes">
...

<div class="form-item">
<label class="option"><input type="checkbox" ...
class="form-checkbox" /> Altro</label>
</div>
</div>
</div>

<div class="form-item">
 <label for="blabla">Other: </label>
 <input type="text" maxlength="128" name="other"
id="other"  size="60" value="" class="form-text" />
</div>

Using css only I find pretty hard to make the textfield fall down and
align with the last item on the checkbox list since it is outside of
the div of the last item.
(float: right/left don't do the job).
It'd be nice to inject the textfield in the same div field of the
last checkbox... but this require to write a not obvious hard to
maintain theme_ function.

I bet other people faced the same problem so I think someone came up
with an elegant solution.


-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the support mailing list