Hello,
The problems i had the other day with my form submission were due to an
error i made in my config.
So i went further in my form processing, and now i face a problem in
form validation.
I have a super simple example :
Here is my template :
<!-- B 'ERRORS:firstname'-->
The first name is not valid.
<!--/B-->
<form action="[!V 'SUBMISSION:FORM:vip_data'/]" method="post"><!--V
'SUBMISSION:PARAMS:vip_data'/-->
<table>
<tr>
<td>First Name</td>
<td><input type="text" name="firstName" length="51"
maxlength="50" /></td>
<td><!--V 'ERRORS:firstname'/--></td>
</tr>
</table>
<input type="submit" name="Validate" /></form>
</form>
Here is my implementation :
public class InscriptionVIP extends Element {
static Logger logger = Logger.getLogger(InscriptionVIP.class);
public void processElement() {
Template template = getHtmlTemplate("myapp.inscription_vip");
VIP vip = (VIP) getNamedSubmissionBean("vip_data", "vip");
if (vip != null) {
Validated v = (Validated) vip;
if (!v.validate())
{
logger.debug("not validated");
generateForm(template, vip);
} else {
logger.debug("validated");
}
}
print(template);
}
}
Validation rules are defined in a Metadata class, associated with the
VIP class.
Here are my problems :
When i submit my form :
* The input is reset to blank.
* The error message is never printed, when the field doesn't pass
validation.
Thanks for your help.
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users