Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Divide checkbox list into 2 columns?
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Divide checkbox list into 2 columns?
You just have to ensure the name/value of the fields is appropriate.

For example, if the key is my_field and values are:

Code:
Option 1
Option 2
Option 3

All checkboxes should have a name of xthreads_my_field[] and values as shown above, such as

HTML Code
<input type="checkbox" name="xthreads_my_field[]" value="Option 1" />
<input type="checkbox" name="xthreads_my_field[]" value="Option 2" />
<input type="checkbox" name="xthreads_my_field[]" value="Option 3" />


I just noticed an issue though: it won't show whether they're checked or not. :/


If you don't mind code edits and want to change the underlying HTML, it's in inc/xthreads/xt_updatehooks.php:

PHP Code:
					if(xthreads_empty($val) && $tf['editable'] != XTHREADS_EDITABLE_REQ)
						$tfinput[$k] .= '<label style="display: block; font-style: italic;"><input'.$tfname.' type="'.$tftype.'" class="'.$tftype.'" value=""'.$checked.$tabindex.' />'.$lang->xthreads_val_blank.'</label>';
					else
						$tfinput[$k] .= '<label style="display: block;"><input'.$tfname.' type="'.$tftype.'" class="'.$tftype.'" value="'.$val.'"'.$checked.$tabindex.' />'.unhtmlentities($val).'</label>';

First instance is just for the "blank value".  Note that it affects both checkboxes and optionbutton inputs.
I'll consider exporting this to a template in a future version.


My Blog
(This post was last modified: 07-20-2011 11:53 AM by ZiNgA BuRgA.)
07-20-2011 11:45 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Divide checkbox list into 2 columns? - ZiNgA BuRgA - 07-20-2011 11:45 AM

 Standard Tools
Forum Jump: