The disabled form element is not submitted

后端 未结 3 1020
闹比i
闹比i 2021-02-20 10:56

I needed to show some preexisting data from a table and but needed to disable them to prevent user from editing them. So i disabled them

$form -> getElement(\"e

3条回答
  •  终归单人心
    2021-02-20 11:35

    This is by design, disabled elements do not get submitted with the form.

    What you are doing is actually a null practice, no matter what you do to that form in put it will be editable by the end user. You simply cannot trust form input - even hidden fields - to not be tampered with.

    Your best bet is to just display the information to the user and load it again after the form has been submitted; at worst store it in a session.

提交回复
热议问题