Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8840861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:33:59+00:00 2026-06-14T10:33:59+00:00

I am trying to make a checkbox, with a label before it that is

  • 0

I am trying to make a checkbox, with a label before it that is not attached to the input, and a label after the checkbox that controls the actual input. It should look like this on the page:

Account Suspended:  [X] Prevent the user from logging in

view.ctp

$this->Form->label('Account Suspended');
$this->Form->input('account_suspended', array(
    'type' => 'checkbox',
    'label' => 'Prevent the user from logging in'
));

The problem I am having at the moment is that the first label is being created with an automatically generated for attribute that matches the ID of the input, so both labels toggle the checkbox if you click them.

The CakePHP generated markup for the first label looks like this, because it is automatically converting the label value into a camel-case ID for the for attribute:

<label for="CustomerAccountSuspended">Account Suspended:</label>

I want the first label to just be:

<label>Account Suspended:</label>

How can I do this using cakePHP FormHelper, and not resorting to manually entering the label HTML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:34:00+00:00Added an answer on June 14, 2026 at 10:34 am

    It’s possible:

    echo $this->Form->label('Account Suspended', null, array('for' => false));
    

    Don’t forget to use translation 😛 Almost every part of every code is reusable. If you don’t need it now, you maybe spare some time in other projects 😉

    Greetings
    func0der

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a custom checkbox, so I made something like that :
I'm trying to make a checkbox that has a custom check image. I need
I'm trying to make a form that validates 1 dropdown only if a checkbox
I'm trying to make a checkbox check when I click not only the checkbox,
I'm trying to make checkbox work like radiobutton with on/off value being passed to
I'm trying to make checkbox enabling with dependencies. I'd like to enable a checkbox
Trying to make the infamous checkall checkbox for dynamically created rows from a MySQL
I'm trying make an entity with doctrine that has three associations with other entities
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a simple number clicker control for BlackBerry 6/7, like this: At

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.