son Posted August 25, 2009 Share Posted August 25, 2009 I have laid out some product variation data in a table with the abiltiy to change colour, size and quantity. It makes sense to have the input and drop-down fields in separate table cells, but now the validation throws up errors as the form is across two cells (it actually also complains when it is in one table cell, just less). I use the following doc type:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">Where am I going wrong?Son Link to comment Share on other sites More sharing options...
Ingolme Posted August 25, 2009 Share Posted August 25, 2009 Two things: You cannot have inline elements directly inside a form:Example of incorrect code:<form>Text</form>OR<form><input></form> You cannot put anything directly inside a <table> element except <tr>, <thead>, <tfooter>, <tbody> and <caption>.You also cannot have anything directly inside a <tr> element except a <th> or <td> element.Example of incorrect code:<table> <form> <tr> <td></td> <td></td> </tr> </form></table>OR<table> <tr> <form> <td></td> <td></td> </form> </tr></table> Link to comment Share on other sites More sharing options...
son Posted August 25, 2009 Author Share Posted August 25, 2009 Two things:You cannot have inline elements directly inside a form:Example of incorrect code:<form>Text</form>OR<form><input></form> You cannot put anything directly inside a <table> element except <tr>, <thead>, <tfooter>, <tbody> and <caption>.You also cannot have anything directly inside a <tr> element except a <th> or <td> element.Example of incorrect code:<table> <form> <tr> <td></td> <td></td> </tr> </form></table>OR<table> <tr> <form> <td></td> <td></td> </form> </tr></table> But how would you do this otherwise? The data needs to be updateable...Son Link to comment Share on other sites More sharing options...
Ingolme Posted August 25, 2009 Share Posted August 25, 2009 You can put the form around the whole table, or inside the table cell. <form> <table> ... ... </table></form>OR<table> <tr> <td> <form></form> </td> </tr></table> As for elements inside the form, you can put them in <div> or <fieldset> elements: <form> <fieldset> Text <input/> </fieldset></form> Link to comment Share on other sites More sharing options...
son Posted August 25, 2009 Author Share Posted August 25, 2009 This is what I also tried. I had: <table><tr><td><form><input>other form elements</form></td></tr></table> and validation still had issues with that...Son Link to comment Share on other sites More sharing options...
Ingolme Posted August 25, 2009 Share Posted August 25, 2009 This is what I also tried. I had:<table><tr><td><form><input>other form elements</form></td></tr></table> and validation still had issues with that...Son You can't put input elements directly inside a form element. I already mentioned it before. Quoted from my previous post:As for elements inside the form, you can put them in <div> or <fieldset> elements:<form> <fieldset> Text <input/> </fieldset></form> Link to comment Share on other sites More sharing options...
son Posted August 26, 2009 Author Share Posted August 26, 2009 You can't put input elements directly inside a form element. I already mentioned it before. Quoted from my previous post:Am with you now...Thanks,Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.