Is it possible to trigger the action of a form with a submit button that's outside the form tags? If so, how should this example be rescripted to make the input tag work outside the form tags?
<html> <body> <form name="input" action="html_form_action.asp" method="get"> First name: <input type="text" name="FirstName" value="Mickey" /><br /> Last name: <input type="text" name="LastName" value="Mouse" /><br /> <input type="submit" value="Submit" /> </form> </body> </html>
Edited by mike_2000_17: Fixed formatting
Here is one example.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <title></title> </head> <body> <form name="myform" id="myform" action="html_form_action.asp" method="get"> First name: <input type="text" name="FirstName" value="Mickey"><br> Last name: <input type="text" name="LastName" value="Mouse"><br> </form> <button onclick="myform.submit();" value="Submit">SUBMIT</button> </body> </html>
Edited by fxm: n/a
Also you don't want to give an input within the form a name="submit", when calling the form's submit function as above, as it will get confused for the forms submit method. As a side note (in case it's not obvious) you can do the above example with any type of element that has an onclick event.
I have published an HTML site from my network drive in my office. I need to put a section where people can leave comments. I tried to read on that as I don't know much about HTML. Can someone help me creat a blog kinda stuff for my HTML site?
try form width:auto;
Hello, I can't display images from database.
I have folder called "images" next to index.php where I keep images.
I suppose I have wrongly defined folder path with images or ...
i am creating an app with android studio and i'm using mySQL.and i want to implement friends feature in my app to enable users send and recieve friend requests, i ...
I recently inherited a project that has been in production for a number of years. They want a new field added. Easy peasy - or so you would ...