Forum
Form Submission Input Value
Hey!
When a form is submitted, is there a way to stop it changing the inputs value automatically? So when i send a form submission, it pre-fills the input with what was sent, but I want it to refresh to default again, rather than pre-filling the input with what was sent before page load.
It's for a hidden input, I've got an ID I want to pass with multiple forms on a page, but it's changing the ID for all the other forms after first submission.
What sort of form? Public form or control panel form?
It's a custom form, for an app.
Someone also mentioned that https://forum.grabaperch.com/forum/03-02-2017-unable-to-submit-2-forms-in-same-template-file may be related.
I'm still unclear.
Are you displaying this form in the control panel, or are you displaying the form on a public web page?
Public page, using Perch:form
Ok. Yes, you can set
env-autofill="false"
on the field.I've got it like so:
<perch:form id="set_list_active" method="post" app="humdinger_list"> <perch:input type="hidden" id="listID" value="<perch:list id="listID" env-autofill="false" />" /> <button class="button tiny" type="submit">Submit</button> <perch:input type="cms" /> <perch:input type="hidden" id="token" />
But it still appears to change the value?
It needs to go on the input.
Ah cool, thanks Drew.
I used the perch shop variant template as an example:
<perch:input id="product" type="hidden" value="<perch:shop id="productID" env-autofill="false" />" />