How can I make an entire HTML form “readonly”?

前端 未结 12 1440
无人及你
无人及你 2020-12-02 07:56

I have two pages with HTML forms. The first page has a submission form, and the second page has an acknowledgement form. The first form offers a choice of many controls, whi

12条回答
  •  不思量自难忘°
    2020-12-02 08:19

    Another simple way that's supported by all browsers would be:

    HTML:

    CSS:

    .disabled {
      pointer-events: none;
      opacity: .4;
    }
    

    But be aware, that the tabbing still works with this approach and the elements with focus can still be manipulated by the user.

提交回复
热议问题