I haven't used the upload component, but the usual way would be to use "validate:required,minlength=3" or something similar in your textfield and rely on client-side validation.
> -----Original Message----- > From: Angelo Chen [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 28, 2008 05:11 > To: [email protected] > Subject: T5: Tapestry-upload and onValidationForm > > > Hi, > > I have a file upload form that requires user to encode a caption, I'm > trying to validate it on onValidateForm, but this is called after file has > been uploaded, > is there a way to check first the caption before uploading taking place? > this will save time. > > Angelo > > < t:form t:id="upload_form"> > <input t:type="upload" t:id="file" size="40" > validate="required"/><br/> > <input t:type="textfield" t:id="caption" size="40" maxlength="40" > /><br/> > <input t:type="submit" value="Upload" name="submit" t:id="submit" > <t:errors/> > < /t:form> > > @Property > private String caption; > > @Component > private Form upload_form; > > void onValidateForm() { > if (!caption) { > upload_form.recordError("caption is empty"); > } > } > -- > View this message in context: http://www.nabble.com/T5%3A-Tapestry-upload- > and-onValidationForm-tp19196916p19196916.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
