netojose / laravel-bootstrap-4-forms

Bootstrap 4 forms for Laravel 5/6/7/8
MIT License
183 stars 58 forks source link

Atrributes without value #87

Open nikuscs opened 5 years ago

nikuscs commented 5 years ago

I believe its not possible to add attributes to a field without value. I can push a PR to fix this issue if necessary.

Example :

<select id="select" class="show-tick form-control" name="multipleSelect" multiple>

JamesPoel commented 4 years ago

You can use select(...)->multiple() for your example.

indigitpt commented 4 years ago

In case of multiple yes, but how about other attributes without value ? Ex : selectable for usage with 3rd Party javascript.

JamesPoel commented 4 years ago

In case of multiple yes, but how about other attributes without value ? Ex : selectable for usage with 3rd Party javascript.

If you set the value to true, it will add the attribute to the element with no value.

select(...)->attrs(['data-custom-attribute' => true]) <select data-custom-attribute ...>...</select>

Similarly, if you set the value to false, the attribute will not be added.

Hope that helps!