[ZPT] DRAMA: Can Formulator Play Nicely With ZPT? (Part II)
Scott Burton
mrzope@hotmail.com
Tue, 15 Oct 2002 07:45:17 +0000
<html><div style='background-color:'><DIV>First, I would like to say sorry for using hotmail :)</DIV>
<DIV> </DIV>
<DIV>> Why doesn't the form validate? How do I make it validate?<BR></DIV>
<DIV>I noticed you wrote: "I've done away with his check_form script <BR>since I'm not interested in authenticating users."</DIV>
<DIV> </DIV>
<DIV>I wrote the username and password in as an example. Without the check_form script, nothing will be posted to the formulator object itself and Formulator will not check the values. The check_form script can stay as it was when I posted it and it will work for any form. Since the Formulator object is what actually does the validation.</DIV>
<DIV> </DIV>
<DIV>Second, it also looks like you removed this tag: <tal:block define="global formErrors python:container.check_form('nameOfFormulatorObject')" /></DIV>
<DIV> </DIV>
<DIV>Again, the validation will not work without that there. This will get called every time the page is accessed but only when it is posted to itself will it enable the execution of this tag: <FONT color=#0000c0><</FONT><FONT color=#000000>span</FONT> <FONT color=#000000>tal</FONT><FONT class=operator color=#0000c0>:</FONT><FONT color=#000000>condition</FONT><FONT class=operator color=#0000c0>=</FONT><FONT class=string color=#004080>"python:request.REQUEST_METHOD == 'POST'"</FONT> <FONT color=#000000>tal</FONT><FONT class=operator color=#0000c0>:</FONT><FONT color=#000000>content</FONT><FONT class=operator color=#0000c0>=</FONT><FONT class=string color=#004080>"structure python:formErrors['username:']"</FONT> <FONT color=#000000>tal</FONT><FONT class=operator color=#0000c0>:</FONT><FONT color=#000000>on</FONT><FONT class=operator color=#0000c0>-</FONT><FONT color=#000000>error</FONT><FONT class=operator color=#0000c0>=</FONT><FONT class=string color=#004080>"string:"</FONT> <FONT color=#000000>style</FONT><FONT class=operator color=#0000c0>=</FONT><FONT class=string color=#004080>"color:red"</FONT><FONT class=operator color=#0000c0>></FONT><FONT color=#000000>error</FONT> <FONT color=#000000>goes</FONT> <FONT color=#000000>here</FONT><FONT class=operator color=#0000c0><</FONT><FONT class=operator color=#0000c0>/</FONT><FONT color=#000000>span</FONT><FONT class=operator color=#0000c0>></FONT></DIV>
<DIV><FONT color=#0000c0></FONT> </DIV>
<DIV><FONT color=#0000c0>If you fix those 2 things, it should work fine for you.</FONT></DIV>
<DIV><FONT color=#0000c0></FONT> </DIV>
<DIV><FONT color=#0000c0>Scott</FONT></DIV></div><br clear=all><hr>Join the world’s largest e-mail service with MSN Hotmail. <a href='http://g.msn.com/1HM1ENUS/c157??PI=44364'>Click Here</a><br></html>