Code
Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy form attribute</title> </head> <body> <form action="form.html" id="form_1" onsubmit="alert('Submitted!');return false;"> Firstname:<input type="text" name="fname"> <br> <input type="submit" value="Submit"> </form> <p>Lastname:<input type="text" name="lname" form="form_1"> </p> </body> </html>
Result