formEncode - complicate validate form

"Grzesiek Slusarek" <[email protected]>
Newsgroups gmane.comp.python.formencode
Organization Poczta Wirtualnej Polski S.A. http://www.wp.pl/
Message-ID <[email protected]>
Hi all. I'm using formEncode to validate my forms, and I'm 
stopped
on how to do a complicated validation that depened on what forms
element was filled. I mean I want to validate file that is 
uploaded but only when the checkbox on the form is checked. How 
to do this?
In python code this looks like:

if form.radio is checked:
    #validate file form that i uploaded
    code...
else:
    #validate other forms fields
    if form.login != '' and form.password !='':
	code..
    else:
	code..

I write my own class to validate file but file is not always sent 
so it must be validate depend on other form's field are checked. 
Thanks for any help
Gregor
 

----------------------------------------------------
Jan Garbarek w Polsce 3-8 czerwca 2006 - Gdansk, Koszalin,
Poznan, Bydgoszcz, Szczecin, Wroclaw - więcej informacji: 
http://klik.wp.pl/?adr=www.JanGarbarek.pl&sid=757




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.