1

Just simple and dumb question.

I am working at a simple website using HTML and PHP.

Today I added the option to change your avatar and put the upload form in a table. I spent 5 minutes to create it, but then, about 5 hours trying to debug it, when suddenly, something hit me. I just copied and pasted the from out of the table, and everything worked as it should. But still, it doesn't work if my form in a table.

PS: When my form is in the table, the submit button just refreshes the page.

Can someone give me a logical reason for this?

EDIT: Ok, somebody requested code, but since somebody else answered my question - there was light. Thank you.

Robert Badea
  • 289
  • 3
  • 7
  • Post some code. Also if its html form in an html table then it has nothing to do with the fact that the html is generate by php. – Philip Kirkbride Jun 08 '12 at 19:07
  • 2
    It will take us 5 months to solve your problem without code – blockhead Jun 08 '12 at 19:07
  • 1
    You cannot put forms inside of tables [Form inside a table](http://stackoverflow.com/a/5967613/1028949) – jeffjenx Jun 08 '12 at 19:08
  • You can put forms inside a `` that is inside a ``. If only we had some code, no one would be shooting in the dark
    – nunespascal Jun 08 '12 at 19:10
  • Like the other's have said, we need to see some code to be able to help you –  Jun 08 '12 at 19:12
  • If the answer below helped, then please "accept" it... and maybe some answers to your other questions too. – Steve Jun 08 '12 at 19:13
  • It should still work while in your table; however, I believe you will need to have your form tag to be on outside of table tag otherwise the tag hierarchy will be weird, do you want to show some code of in table and out of table? – richardhsu Jun 08 '12 at 19:07
  • I believe this would solve your problem but, we cannot begin to know until we see some code – Chris James Champeau Jun 08 '12 at 19:11

1 Answers1

0

Forms cannot go anywhere in between <table> and <td>. They can go inside of <td>, though. And, obviously they can (and usually should) go outside of <table>.

Jonathan M
  • 17,145
  • 9
  • 58
  • 91