I am encountering a strange issue when working with forms. When the field name starts with an underscore, the data that the form contains is not in the form scope. However, the field is still present in
Here is a dump of my form scope:
OS: Windows 11
Java Version: 17.0.6
Lucee Version: 184.108.40.206
I have read somewhere that form names are starting with underscore should be avoided. I saw that somewhere when having issues with dots in some form fieldnames (something we should also avoid). Best I can find for now is here:
So there is no apparent fix for my issue, for instance modifying the something in the config?
<form action="?" method="POST">
<input type="hidden" name="_one" value=1>
<input type="hidden" name="one" value=1>
Then I’m guessing the issue has something to do with masa. I’ll just use js to get the data
A working example is always the best! If it works, it works! Thanks Zac!
Just for completeness, I found what I mentioned. It’s in the HTML4 specs:
for anyone who ever encounters the same issue and stumbles across this:
I’ve managed to retrieve the data by renaming the form fields before submitting them using JQuery
// gets form data because masa/mura ignores fields starting with _