Submitter should be left out from data if its name is empty
jiripudil opened this issue · 3 comments
jiripudil commented
Bug Report
As reported on Nette Forum, Naja adds the submitter to the form data even if it has an empty name. According to the HTML spec, fields with an empty name should be omitted from the data set though.
rajdama commented
I can do this.
jiripudil commented
Sure, go ahead, thank you!
Essentially it should suffice to
- add
element.name !== ''
to the condition (while you're at it, I think the|| element.tagName === 'BUTTON'
part is a bug too and should be removed), and - update the
element.type === 'image'
branch so that it appends justx
andy
without the dot ifelement.name === ''
.
rajdama commented
Noted 👍