Hallo
Im using custom form but then i consideret 2 problems
1) errors are not more camputred or displayed
2) form won't be submitted: when i click on submit the page just reload
(keeping the old values)
in controller i have :
def new():
form=crud.create(db.i2l_letter)
if form.accepts(request.vars, session):
response.flash='Bitte warten'
elif form.custom.errors:
response.flash='Bitte fuellen sie das Formular richtig aus'
else:
pass
return dict(form=form)
in view i have
{{if form.errors:}}
Your submitted form contains the following errors:
<ul>
{{for fieldname in form.errors:}}
<li>{{=fieldname}} error: {{=form.errors[fieldname]}}</li>
{{pass}}
</ul>
{{form.errors.clear()}}
{{pass}}
{{=form.custom.begin}}
<table>
<tr>
<td>{{=form.custom.label.date_format}}</td>
<td>{{=form.custom.label.myref}}</td>
<td>{{=form.custom.label.yourref}}</td>
</tr>
<tr>
<td>{{=form.custom.widget.date_format}}</td>
<td>{{=form.custom.widget.myref}}</td>
<td>{{=form.custom.widget.yourref}}</td>
</tr>
</table>
<div style="float: left; clear:both; margin-top:20px;
margin-left:50px">{{=form.custom.submit}}</div>
{{=form.custom.end}}
{{pass}}
--