...

View Full Version : Form tags on input buttons?



Krashsite
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'">

semiSkim
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.

Krashsite
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.

Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum