Code Monkey home page Code Monkey logo

Comments (5)

lilHermit avatar lilHermit commented on July 21, 2024

Original comment by l (Bitbucket: lilHermit, GitHub: lilHermit)


Released 4.0.0.4002

from cakephp-plugins-bootstrap4.

lilHermit avatar lilHermit commented on July 21, 2024

Original comment by l (Bitbucket: lilHermit, GitHub: lilHermit)


Fixed in c755d46

from cakephp-plugins-bootstrap4.

lilHermit avatar lilHermit commented on July 21, 2024

Original comment by l (Bitbucket: lilHermit, GitHub: lilHermit)


Ok it looks like the plugin isn't adding the required class currently I'll fix that in the next release.

As a current workaround try:

    label.required:after {
        content: " *";
        color: red;
    }
</style>```

and with the following PHP

```php
echo $this->Form->control('given_name', [
                    'label' => ['class' => 'required'],
                    'required' => true
                ]);

from cakephp-plugins-bootstrap4.

lilHermit avatar lilHermit commented on July 21, 2024

Original comment by Thomas Georgiadis (Bitbucket: ThomasNucleus, GitHub: ThomasNucleus)


It doesn't seem like a required class is being added to the form-group class div

#!html

<div class="form-group <!--required missing?-->">
   <label class="col-form-label" for="person-given-name">Given Name</label>
   <input type="text" name="person[given_name]" required="required" id="person-given-name" class="form-control" value="Test 1">
</div>

Also wouldn't that css put the asterisk where I've indicated with a black asterisk?
Capture.PNG

Ideally I would like the the asterisk to be right next to the label. I can tweak that css to work if either the form-group or label has a required class.

from cakephp-plugins-bootstrap4.

lilHermit avatar lilHermit commented on July 21, 2024

Original comment by l (Bitbucket: lilHermit, GitHub: lilHermit)


I'd suggest the best way would be via css rather than messing with the CakePHP templates

Something like?
div.form-group.required:after { content:" *"; color:red; }

from cakephp-plugins-bootstrap4.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.