I have a HTML form where one of the inputs is called named submit
I also have a nicely formatted HTML element inside the form which is supposed to submit the form on click.
I noticed that form.submit is overridden by the input field which is named submit so I can't call form.submit() anymore.
I've searched for an answer, the general response is to rename the input. However I cannot do that. submit most appear as a parameter with a value in the request body.
Example code:
<form action="http://example.com/search" method="POST">
<!-- other generated parameters -->
<input value="findItems" name="submit" type="hidden">
<a onclick="event.stopPropagation();this.parentNode.submit()" href="javascript:{}">
<!-- this is dinamically generated
and generally much more complex --->
<strong>search</strong>
</a>
</form>
Keep in mind that my constraints are the following:
- the element which the users clicks to submit the form is contains other formatted elements
submitis a required parameter in the request body- the request method must be POST
- cannot make any modifications to the back-end
PS: this is my first question on stack overflow, love this site.