[Zope] absent variables

Uwe C. Schroeder Uwe.Schroeder@contrada.de
Thu, 19 Apr 2001 16:10:56 +0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 19 April 2001 11:29, Miha wrote:

Hi,

see the HowTo

"Form Variable Types and Typechecking"

You can give extented attributes to form fields that will be handled by z=
ope.=20
It's briefly explained in the mentioned howto.
The howto can be found on zope.org

> Hello all in,
>
>    I meet problem, may be somebody can help me. I try to send results
>    of filled form thought dtml-method (proxy of course), but user can
>    don't fill some input values. When I submit form with unchecked
>    checkbox (name favorite) I receive error:
>           Error Type: Bad Request
>           Error Value: ['favorite']
>
>    How i can create default values for favorite?
>    My SQL query for ZGadFlyDB:
>          create TABLE REPORTS ( COUNTRY VARCHAR, REGION VARCHAR,
>                                 TOWN VARCHAR,    NAME VARCHAR,
>                                 ADRESS VARCHAR,  EMAIL VARCHAR,
>                                 TEL VARCHAR,     FAVORITE VARCHAR)
>
>
>    My code:
> ---[FORM::DTML-Document
> <form name=3D"startNewLife" method=3D"post" action=3D"reportAction">
>   Country <input type=3D"text" name=3D"country" value=3D"Russia">
>   Region <input type=3D"text" name=3D"region">
>   Town <input type=3D"text" name=3D"town">
>   Name <input type=3D"text" name=3D"name">
>   Address <input type=3D"text" name=3D"adress">
>   e-mail <input type=3D"text" name=3D"email">
>   Tel <input type=3D"text" name=3D"tel" value=3D"+7(   )">
>   Favorites <input type=3D"checkbox" name=3D"favorite" value=3D"var1"> =
var1
>   <br>
>   <input type=3D"checkbox" name=3D"favorite" value=3D"var2"> var2<br>
>   <input type=3D"checkbox" name=3D"favorite" value=3D"var3"> var3<br>
>   <hr>
>   <input type=3D"submit" value=3D"Snd">
>    <input type=3D"reset" value=3D"Rst">
> </form>
> ---[/FORM
>
> ---[insert::Z SQL Method
> Arguments:
>
> country
> region
> town
> name
> adress
> email
> tel
> favorite
>
> Body:
>
> insert into REPORTS
>   values(
> <dtml-sqlvar country type=3D"string">,
> <dtml-sqlvar region type=3D"string">,
> <dtml-sqlvar town type=3D"string">,
> <dtml-sqlvar name type=3D"string">,
> <dtml-sqlvar adress type=3D"string">,
> <dtml-sqlvar email type=3D"string">,
> <dtml-sqlvar tel type=3D"string">,
> <dtml-sqlvar favorite type=3D"string">)
> ---[/insert
>
> ---[reportAction::DTML Document::Proxy(Manager)
> <dtml-call insert>
> <h3>Thx!</h3>
> ---[/reportAction
>
>
> Big thanks
> -
> M. (mailto:Miha@instock.ru)
> Developer.
> http://www.instock.ru/
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

- --=20
	Uwe C. Schr=F6der

- --
Uwe C. Schr=F6der                                      ConTrada Consultan=
ts
Lindenstrasse 15                                     Tel/Fax: +49 8294 80=
070
D-86477 Adelsried                                    Mobil:   +49 172 853=
2352
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE63vHwTJbO78VG0aIRApWgAJoDfD3Pu3s+3IiZZLsCDzFEirCV8QCfXG18
4fPBOSnSx1tbxH6VhB/nH2w=3D
=3DQdoI
-----END PGP SIGNATURE-----