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

前端 未结 12 1451
无人及你
无人及你 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:36

    There is no built-in way that I know of to do this so you will need to come up with a custom solution depending on how complicated your form is. You should read this post:

    Convert HTML forms to read-only (Update: broken post link, archived link)

    EDIT: Based on your update, why are you so worried about having it read-only? You can do it via client-side but if not you will have to add the required tag to each control or convert the data and display it as raw text with no controls. If you are trying to make it read-only so that the next post will be unmodified then you have a problem because anyone can mess with the post to produce whatever they want so when you do in fact finally receive the data you better be checking it again to make sure it is valid.

提交回复
热议问题