<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- We need a doctype to allow us to use special characters like
We use a "strict" DTD to make IE follow the alignment rules. -->
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_4.xsd">
<body class="container">
<h3>Multiple Forms (1)</h3>
This page demonstrates how to handle a page with more than one Form.
<div class="eg">
<t:form class="form-inline" t:id="searchcustomers">
<div class="form-group">
<t:label for="customerName"/>
<t:textfield t:id="customerName"/>
<t:submit value="Search Customers"/>
</div>
</t:form>
<t:form class="form-inline" t:id="searchsuppliers">
<div class="form-group">
<t:label for="supplierName"/>
<t:textfield t:id="supplierName"/>
<t:submit value="Search Suppliers"/>
</div>
</t:form>
</div>
To help us determine which Form has been submitted we give each Form a component id.<br/>
In this example the ids are "searchcustomers" and "searchsuppliers".<br/>
We include the id in their event handler method names: onSuccessFromSearchCustomers() and onSuccessFromSearchSuppliers().<br/><br/>
References: <a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/Form.html">Form</a>,
<a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/TextField.html">TextField</a>,
<a href="http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/Errors.html">Errors</a>,
<a href="http://wiki.apache.org/tapestry/Tapestry5HowToUseForms">How To Use Forms</a>,
<a href="http://tapestry.apache.org/forms-and-validation.html">Forms and Validation</a>.<br/><br/>
<t:pagelink page="Index">Home</t:pagelink><br/><br/>
<t:tabgroup>
<t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/input/MultipleForms1.tml"/>
<t:sourcecodetab src="/web/src/main/java/jumpstart/web/pages/examples/input/MultipleForms1.java"/>
<t:sourcecodetab src="/web/src/main/resources/META-INF/assets/css/examples/multipleforms1.css"/>
</t:tabgroup>
</body>
</html>