View Full Version : Form tags on input buttons?

07-15-2010, 02:10 AM
Is it necessary (or advisable) to place <form> tags around input buttons? They seem to work fine either way.

<input type="button" value=" Home " onClick="parent.main.location='home.htm'">

07-15-2010, 02:12 AM
Don't worry about the form tag. You only need to use it when submitting data to another page with POST or GET.

Old Pedant
07-15-2010, 02:20 AM
Some older browsers (Nescape 4, I remember) would not show a form field if it did not have <form>...</form> around it.

I don't know if any modern browsers have the same limitation.

But what harm does it do to use <form>...</form>???

You could just use one <form> at the top of the page and one </form> at the bottom of the page.

07-15-2010, 03:29 AM
Just cleaning up some code. Found I'd been using it both ways, without any problems, and wondered which was strictly correct.