D
D
Dmitry Kulikov2015-11-27 11:55:38
css
Dmitry Kulikov, 2015-11-27 11:55:38

How to make button disabled in bootstap-3?

It is possible to replace radio buttons with buttons in bootstape getbootstrap.com/javascript/#buttons
Works as it should, but I can't figure out if it's possible to make a button inactive if the switch has a disabled attribute
This construction helped

$('.btn.disabled').on('click',function(e){e.stopPropagation();})

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mikhail, 2015-11-27
Chirskiy @chirskiy_mixail

CSS has a wonderful property

.disabled {
    pointer-events: none;
}

It completely blocks any event, including scripts

S
Semyon, 2015-11-27
@skamenetskiy

As far as I know, out of the box - no. You can make your own :)

A
Alexey, 2015-11-27
@alex-saratov

Why not, add disabled="disabled" and the button is not active.
Here is an inactive button from your example
Soori. I haven't read about switches. For the switch, the code allows you to make it inactive, but JS works.

<label class="btn btn-primary"  disabled="disabled">
  <input type="radio" name="type_edit" id="option2" autocomplete="off">Изменить
</label>

Was wrong about the switch.

D
Dmitry Kulikov, 2015-11-27
@dmitryi_k

<label class="btn btn-primary disabled">
  <input disabled="disabled" type="radio" name="type_edit" id="option2" autocomplete="off">Изменить
</label>

Since the comment does not allow me to insert the code, I will write it separately, I am interested in a similar design, and an inactive button in it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question