html5 - How to resolve the following HTML error? -


i have following lines in django template file:-cart.html:-

<td class="right">     <form method="post" action="." class="cart">         <label for="quantity">quantity:</label>         <input type="text" name="quantity" value="{{ item.quantity }}" id="quantity" size="2" class="quantity" maxlength="5" />         <input type="hidden" name="item_id" value="{{ item.id }}" /> </td> <td>     <input type="submit" name="submit" value="update" />     </form> </td> 

at first closing tag of td i.e first </td>,i following error: element form not closed.please me rectify error.

html tags must structured in directly hierarchic manner. closing tag opened inside closed elements incorrect , produce errors , issues.

enclose form inside table data, this:

<td class="right">     <form method="post" action="." class="cart">         <label for="quantity">quantity:</label>         <input type="text" name="quantity" value="{{ item.quantity }}" id="quantity" size="2" class="quantity" maxlength="5" />         <input type="hidden" name="item_id" value="{{ item.id }}" />         <input type="submit" name="submit" value="update" />     </form> </td> 

or enclose either whole table or table elements inside form, this:

<form method="post" action="." class="cart">     <td class="right">         <label for="quantity">quantity:</label>         <input type="text" name="quantity" value="{{ item.quantity }}" id="quantity" size="2" class="quantity" maxlength="5" />         <input type="hidden" name="item_id" value="{{ item.id }}" />     </td>     <td>         <input type="submit" name="submit" value="update" />     </td> </form>     

i assume latter solution 1 you're looking for.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -