Child pages
  • Why do the form tags put table tags around controls

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For example, a form like this

Code Block
HTMLtileJSP fragmentHTML
languagexml
titleJSP fragment
<s:form method="post">
    <s:textfield label="Name" name="name"/>
    <s:textfield label="Age" name="age"/>
    <s:submit/>
</s:form>

using the default XHTML team, renders like this

Code Block
HTML
languagexml
titleGenerated HTML fragmentHTML

<form id="quizBasic" name="quizBasic" onsubmit="return true;"
    action="/struts2-showcase/validation/quizBasic.action" method="post">
    <table class="wwFormTable">
        <tr>
            <td class="tdLabel">
                <label for="quizBasic_name" class="label">Name:</label>
            </td>
            <td>
                <input type="text" name="name" value="" id="quizBasic_name" />
            </td>
        </tr>
    
        <tr>
            <td class="tdLabel">
                <label for="quizBasic_age" class="label">Age:</label>
            </td>
            <td>
                <input type="text" name="age" value="0" id="quizBasic_age" />
            </td>
        </tr>
    
        <tr>
            <td colspan="2">
               <div align="right">
                   <input type="submit" id="quizBasic_0" value="Submit" />
               </div>
            </td>
        </tr>
    </table>
</form>

...