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;
I am currently practicing my java skills by doing this program called car rental management system. I am creating a login page where when the user login it ...
I'm having a very seriouse problem where I have a textbox and I want a button and I want to take whatever a user type in this textbox/textarea ...
Hey everyone, I have a table, that is going to used to calculate IFTA, its a fueltax calculator populated by each state and the rate of each state. My question ...