How to enable one button inside a disabled fieldset

后端 未结 3 1311
慢半拍i
慢半拍i 2020-12-17 08:14

I want to disable all the elements inside Fieldset but enable few buttons inside it. Demo:

Personal
3条回答
  •  感情败类
    2020-12-17 08:42

    Solution 1 - use icons with click event

    Use icons instead of buttons and attaching the click event to the icons. This bypasses the disabled fieldset and works like a charm.

    and the javascript (using angularjs)

    $scope.openModal = ()=>{
      // do stuff
    };
    

    Solution 2 - use a Bootstrap-styled span with click event

    Bootstrap can style a span to look exactly like a button. Spans do not use, or inherit, the disabled attribute.

    Button Text

    and the javascript (using angularjs)

    $scope.openModal = ()=>{
      // do stuff
    };
    

提交回复
热议问题