root/branches/gettext/examples/templates/example_parser_pattemplate_2forms.ftmpl

Revision 123, 3.4 kB (checked in by schst, 4 years ago)

patForms_Parser: added support for multiple forms in one file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <pattemplate:tmpl name="form">
2
3 <!--
4     Form errors template - the formErrorsEntry template is the
5     one you have to set as "errorTemplate" parameter in the
6     renderForm() call. It is rendered automatically by the
7     Parser's patTemplate renderer.
8    
9     You can access the entire attribute collection of each
10     element that has errors via the {FIELD_XXX} variables, and
11     the error variables via the {ERROR_XXX} variables.
12    
13     Available error variables:
14     - code
15     - field (the fieldname)
16     - message
17     - type (the fieldtype, e.g. "String")
18 -->
19 <pattemplate:tmpl name="formErrors" visibility="hidden">
20 <div class="piErrors">
21     <div class="piErrorsTitle">Validation failed</div>
22     <div class="piErrorsContent">
23         Sorry, but the credentials you provided are not entirely correct. You're not going to get past this easily!<br/><br/>
24    
25         <pattemplate:tmpl name="formErrorsEntry">
26         <div class="piError">
27             <b>{FIELD_LABEL}:</b> {ERROR_MESSAGE} (Error #{ERROR_CODE})<br/>
28         </div>
29         </pattemplate:tmpl>
30     </div>
31 </div>
32 </pattemplate:tmpl>
33
34 <pattemplate:tmpl name="formSuccess" visibility="hidden">
35 <div class="piHint">
36     <b>Success!</b> Very well done, you've successfully provided a valid set of credentials for your login.
37     Unfortunately, this is only a dummy login... there's nothing to log into. But you
38     would have had there been :)
39 </div>
40 </pattemplate:tmpl>
41
42 <patForms:Form name="login">       
43 <div class="piFrame">
44     <div class="piTitle">Login</div>
45     <div class="piContent">
46        
47         <div class="piAbstract">
48             Please provide your credentials here to log into your personal patForms example
49             collection.
50         </div>
51        
52         <table border="0" cellpadding="2" cellspacing="0">
53             <tr>
54                 <td>{USERNAME_LABEL}</td>
55                 <td>
56                     <table cellpadding="0" cellspacing="0" border="0">
57                         <tr>
58                             <td><patForms:String name="username" label="Username" required="yes" description="Please enter your username here" size="8" maxlength="8" title="Enter your username. Max. length [ELEMENT_MAXLENGTH]" accesskey="U" /></td>
59                             <td>&nbsp;{PASSWORD_LABEL}&nbsp;</td>
60                             <td><patForms:String name="password" label="Password" type="password" required="yes" size="8" maxlength="8" minlength="6" title="Enter your password. Max. length [ELEMENT_MAXLENGTH] / Min. length [ELEMENT_MINLENGTH]" accesskey="P" /></td>
61                             <td>&nbsp;{AGE_LABEL}&nbsp;</td>
62                             <td><patForms:Number name="age" label="Age" required="yes" size="2" max="30" min="12" default="" title="Enter your age. Max [ELEMENT_MAX] / Min [ELEMENT_MIN]" accesskey="A" /></td>
63                         </tr>
64                     </table>
65                 </td>
66             </tr>
67         </table>
68        
69     </div>
70 </div>
71 <input type="submit" name="save1" value="Save" accesskey="S" />
72 </patForms:Form>       
73
74 <patForms:Form name="forgot">       
75 <div class="piFrame">
76     <div class="piTitle">Forgot your password?</div>
77     <div class="piContent">
78        
79         <div class="piAbstract">
80             Please enter your eMail address:
81         </div>
82        
83         <table border="0" cellpadding="2" cellspacing="0">
84             <tr>
85                 <td>{EMAIL_LABEL}</td>
86                 <td><patForms:String name="email" label="eMail" required="yes" description="Please enter your email here" size="30" maxlength="100" title="Enter your Email" accesskey="E" /></td>
87             </tr>
88             <tr>
89                 <td>{COMMENTS_LABEL}</td>
90                 <td colspan="7"><patForms:Text name="comments" label="Comments" required="no" cols="68" rows="3" title="Enter any comments here" accesskey="C" /></td>
91             </tr>
92         </table>
93        
94     </div>
95 </div>
96 <input type="submit" name="save2" value="Save" accesskey="S" /></patForms:Form>     
97 </pattemplate:tmpl>
Note: See TracBrowser for help on using the browser.