P粉4329068802023-08-22 15:04:37
In HTML5, there is form attribute. basically
<form id="myform" method="get" action="something.php"> <input type="text" name="name" /> </form> <input type="submit" form="myform" value="Update"/>
P粉0185484412023-08-22 11:58:02
Update: In modern browsers, you can use the form
attribute to achieve this .
As far as I know, you can't achieve this functionality without using JavaScript.
This is the description in the specification
This is the part I bolded
submit
Buttons are considered controls.
http://www.w3.org/TR/html4/interact/forms.html#h-17.2.1
Based on comments
Why not put the input
inside the form, but use CSS to place it elsewhere on the page?