Hi! I'm trying to create a set of checkboxes with an "other" option, so that it would look something like: What is your favourite color? [ ] Red [ ] Blue [ ] Maroon [ ] Other [_________________________________] How can I place a field next to the other checkbox? Thanks, Ricky The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.
I've never tried it, but maybe you could drupal_render() a text field with no title of its own into the title value for other? Richard Morse wrote:
Hi! I'm trying to create a set of checkboxes with an "other" option, so that it would look something like:
What is your favourite color?
[ ] Red [ ] Blue [ ] Maroon [ ] Other [_________________________________]
How can I place a field next to the other checkbox?
Thanks, Ricky
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.
This is more a theme question then develop, no? You just set both objects (last check and edit) within one DIV to control its positions in the $form['checkbox'], set 'prefix' to something like '<div id=other>'; in the 'suffix' of your textfield, set '</div>'; Then with CSS, change the checkbox class to float: left, (this is a guess). CSS is not my strong knowledge, I allways strugle a little :) Feijó -------------------------------------------------- From: "Richard Morse" <remorse@partners.org> Sent: Friday, January 18, 2008 3:31 PM To: <development@drupal.org> Subject: [development] Form API layout question...
Hi! I'm trying to create a set of checkboxes with an "other" option, so that it would look something like:
What is your favourite color?
[ ] Red [ ] Blue [ ] Maroon [ ] Other [_________________________________]
How can I place a field next to the other checkbox?
Thanks, Ricky
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.
On Fri, 18 Jan 2008 12:31:14 -0500 Richard Morse <remorse@partners.org> wrote:
Hi! I'm trying to create a set of checkboxes with an "other" option, so that it would look something like:
What is your favourite color?
[ ] Red [ ] Blue [ ] Maroon [ ] Other [_________________________________]
How can I place a field next to the other checkbox?
Writing your own form theming function. themename_formid() (etc...) Another simpler (for css wizards) way would be to define a style for a particular field, put a div around it (#prefix, #suffix), subclass form-item in your css eventually and made it so that you don't have a "new line after "Other". I'd advise to skip completely the checkbox [] Other and just leave the open text field... if people write there... well it as if they checked other... and the form is faster to fill even if a bit more complex to do stats on it. -- Ivan Sergio Borgonovo http://www.webthatworks.it
On Jan 18, 2008, at 12:31 PM, Richard Morse wrote:
Hi! I'm trying to create a set of checkboxes with an "other" option, so that it would look something like:
What is your favourite color?
[ ] Red [ ] Blue [ ] Maroon [ ] Other [_________________________________]
How can I place a field next to the other checkbox?
Hi! Thanks to the suggestions of other people, I was able to solve this using javascript -- jQuery has a "append" function that moves items around in the DOM. Ricky The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.
participants (4)
-
Alessandro Feijó -
David Norman -
Ivan Sergio Borgonovo -
Richard Morse