1

What's the purpose of {{ hiddenInput('enabled', '1') }} in an entry form?

<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
{{ actionInput('entries/save-entry') }}
{{ redirectInput('viewentry/{slug}') }}
{{ hiddenInput('sectionId', '2') }}
{{ hiddenInput('enabled', '1') }}

1 Answer 1

2

It is to generate an HTML input tag with type of hidden. This will not appear on the screen like a normal input does. For more information related to input type hidden, you can refer to this.

enabled means that the entry will be saved with its status toggle set to the “enabled” (green) position.

2
  • bro thanks for the answer...but what is it used for in a site?ie..what is the status toggle used for?
    – jamesSeb
    Commented Mar 28, 2020 at 18:50
  • usually, it's used to sent some item for example : id user that you get from database. But in your question this input used to determine in which section your entries will be saved. for toggle status I can't say for sure, I cannot find much documentation for this toggle.
    – aodihis
    Commented Apr 1, 2020 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.