Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Form Nonce on Multiple Forms

Started by Muut Archive 9 years ago · 2 replies · 709 views
9 years ago

Hi
I have a modular page with more than one form. Everything works as expected but the page doesn't validate.
The reason for this is that each form has a field as follows

TXT
<input type="hidden" id="form-nonce" name="form-nonce" value="********" />

As you can see, the input has an id of form-nonce and you can only have one instance of an id per page if you want to be able to pass HTML validation.

Also, the value for each form-nonce is the same for every form, should it be different?

9 years ago

It's correct that the value of the form-nonce is the same one for all the frontend forms, as it's a temporary value linked to the session and the current site security salt, renewed every 12 hours.

I don't think HTML validation with multiple forms on the same page was ever considered, open an issue on https://github.com/getgrav/grav-plugin-form/issues so we can track it.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago