We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Checkboxes

Development and Programming

james Brown's avatar
james Brown
492 posts
16 years ago
james Brown's avatar james Brown

oops

       
Shannon Smith's avatar
Shannon Smith
161 posts
16 years ago
Shannon Smith's avatar Shannon Smith

If anyone is looking to use Checkboxes Extension in a stand alone EDIT form using Form Helper plugin, you can get it to work with some fairly easy php. I’ve posted a link at Solspace’s Form Helper Support forum on how to do it.

http://www.solspace.com/forums/viewthread/2285/

Hope this helps.

Thanks to Brian M. for his help in getting this solution to work.

Checkboxes will also work in a SAEF (stand alone entry form) using the code that Brian M. posted on here in an earlier message.

       
Spazsquatch's avatar
Spazsquatch
112 posts
16 years ago
Spazsquatch's avatar Spazsquatch

If anyone is interested, or at least so I can find it in the future…

If you have really long labels, and need to change the number of columns in the control panel in order to make it legible, open ext.checkbox.php and look for:

//
//  Publish Tab
//
function publish( $row, $field_data )

Within that function you’ll see the number 7 repeated several times, replace it with the number of columns you desire.

There is also some bit that look like:

$r .= $DSP->table_qcell("", "", "14%");

If anyone can figure out what that does I would love the heads up.

       
Narthex's avatar
Narthex
83 posts
16 years ago
Narthex's avatar Narthex

For those unclear on the concept (as I was), here is how this works:

This extension adds a “checkbox” choice when you are creating a Custom Field. To create a custom field follow these breadcrumbs in your Control Panel: CP Home › Admin › Weblog Administration › Field Groups › Custom Fields

You can create a required checkbox by installing this extension, creating a custom field, choosing “textbox” and selecting “yes” to the question, “Is this a required field?”

just for the sake of people finding this page by search (as I was)… “make a checkbox required” “required checkbox”

Peace, N+

P.S. Here’s a very simple example of the checkbox in normal EE code (what’s with all the php in this thread… Ya’ll’er geniuses!)

<input class="saef_inputs" type="checkbox" name="field_id_14" id="field_id_14" /><label for="field_id_14">I am not violating copyrights by uploading this file.</label>
       
phoebe_reed's avatar
phoebe_reed
82 posts
15 years ago
phoebe_reed's avatar phoebe_reed

Hi,

I’ve installed the checkboxes extension, which is working well.

But, I need to display the values from my custom field separately – is there any way to parse them so that I can show, from field1:

value1 [formatting code here] value2 [formatting code] value3 etc.

right now, it just comes as one glob: value1, value2, value3

Thanks for any help!

Phoebe

       
mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse

Hello,

Anyone else getting this, or similar, error:

Warning: Typography::require_once(/home/user/public_html/system/plugins/pi..php) [function.Typography-require-once]: failed to open stream: No such file or directory in /home/user/public_html/system/core/core.typography.php on line 474

Fatal error: Typography::require_once() [function.require]: Failed opening required '/home/user/public_html/system/plugins/pi..php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/system/core/core.typography.php on line 474

I get the above error when publishing an entry with a custom field checkbox “checked”… If the entry has the checkbox un-checked, then I do not get the error.

I really think this is the solution:

“Fix-It-Yourself Extensions, or The Field Formatting Fiasco” http://devot-ee.com/articles/item/fix-it-yourself-extensions-or-field-formatting-fiasco/

But I am not sure exactly where to insert the fix into the checkbox extension…

Anyone here ever experience the same problem? If so, have you applied a fix? If so, feel like saving me some time? :D

Thanks! Micky

       
mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse
Anyone here ever experience the same problem? If so, have you applied a fix? If so, feel like saving me some time? :D

Ahh, fixed it… At least from the few tests I have done, I am no longer getting that error.

Changed this code (starting on line 275):

if($key +1 % 7 != 0)
{
    while(($key +1) % 7 != 0)
    {
        $r .= $DSP->table_qcell("", "", "14%");
        $key++;
    }
    $r .= $DSP->tr_c();
}

$r .= $DSP->table_close();

To this:

if($key +1 % 7 != 0)
{
    while(($key +1) % 7 != 0)
    {
        $r .= $DSP->table_qcell("", "", "14%");
        $key++;
    }
    $r .= $DSP->tr_c();
}

// add formatting
$r .= $DSP->input_hidden('field_ft_' . $row['field_id'], $row['field_fmt']);

$r .= $DSP->table_close();

Seems to work for me.

Thanks to devot-ee for the informative post, and to Mark for the kick-butt addons!!!

Cheers, Micky

       
Ryan M.'s avatar
Ryan M.
1,511 posts
15 years ago
Ryan M.'s avatar Ryan M.

Mickey - That’s pretty much what you needed to do. A lot of the older add-ons that haven’t been updated in a while (or at least since EE 1.6.5) don’t have that bit of PHP in there. Glad you got it sorted out.

       
mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse

Hi Ryan!

Yah, thanks for the reply, and thanks for spreading around that very helpful information. Your forum posts, and Devot:ee, have saved the day!

Have an excellent day. Cheers, Micky

       
ASC's avatar
ASC
21 posts
15 years ago
ASC's avatar ASC

Uh, I have

{exp:weblog:entries ...blah blah...}
{checkbox_field}
{custom_field2}
{custom_field3}
{/exp:weblog:entries}

With extension enabled, all three fields display the value of the checkbox field.

With extension disabled, it works as expected.

Any idea what’s going on? a

       
mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse
Any idea what’s going on?

Hi,

So, are you saying that your custom fields are outputting the value of one checkbox field?

You might try naming your custom fields differently… For example, instead of:

{checkbox_field}
{custom_field2}
{custom_field3}

Try:

{checkbox}
{custom_field2}
{custom_field3}

In other words, make the name completely different from any other custom field. I only mention this because I have run into field naming problems when using MH File:

http://ellislab.com/forums/viewthread/38997/P900/#636355

Also, what does this output:

{exp:weblog:entries ...blah blah...}
{checkbox_field}
{/exp:weblog:entries}

And vice versa:

{exp:weblog:entries ...blah blah...}
{custom_field2}
{custom_field3}
{/exp:weblog:entries}

If none of the above helps, you will probably have to post more detailed info and/or your exact template code.

What version of EE? What version of PHP? What other addons/extensions installed?

       
ASC's avatar
ASC
21 posts
15 years ago
ASC's avatar ASC

Many thanks. Changing the field name worked. The actual fieldnames were {projects_video} <–checkbox {projects_video_thumbnail}

{projects_video_url}

Changing {projects_video} to {mycheckbox} made the problem go away.

[for the record, I first tried the other ideas, thinking there was no way the above could be true 😊

Removing the custom fields leaving only the checkbox field resulted in the checkbox field’s value being outputted.

Removing the checkbox field (as in visa-versa above) did not change the output of the others - they still show the value of the checkbox field.

EE 1.6.8 PHP 5.2.6 Other Extensions: LG Twitter, Tag Submit Plugins: default Modules: default + Discussion Forum, Wiki, Tag ]

       
mhulse's avatar
mhulse
329 posts
15 years ago
mhulse's avatar mhulse
Many thanks. Changing the field name worked. The actual fieldnames were {projects_video} <–checkbox {projects_video_thumbnail} {projects_video_url} Changing {projects_video} to {mycheckbox} made the problem go away. [for the record, I first tried the other ideas, thinking there was no way the above could be true 😊

Woot!!!!

Yah, it is an easy bug to overcome, just annoying if you do not realize it is a bug.

Glad I was able to help! 😊

Cheers, Micky

       
First 6 7 8

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.