[Zope-dev] How-to : Defining custom DTML-tags ??

Casey Duncan casey@zope.com
10 Jun 2002 09:53:58 -0400


I would recommend looking at a product that defines a dtml tag. Calendar
tag, set tag and eval tag are all ones that come to mind.

hth.

Casey

On Mon, 2002-06-10 at 09:35, Thomas Weholt wrote:
> I want to create a custom DTML-tag. How/where do I start ?
> 
> My goal is to create a way to define a form and validate the input ( that
> integers are valid, required fields filled out etc. ) using Javascript in
> the browser and 
> and on the server side after posting. Any thoughts ? 
> 
> I was thinking something along the lines of :
> 
> <dtml-form name="form1">
>    <dtml-field input="text" name="name" type="string" required=1>
>    <dtml-field input="text" name="email" type="string">
>    <dtml-field input="select" name="programming_language">
>        <dtml-selectOption>Python</dtml-selectOption>
>        <dtml-selectOption>Perl</dtml-selectOption>
>        <dtml-selectOption>C</dtml-selectOption>
>    </dtml-field>
>   <dtml-field input="checkbox" name="recieve_spam" checked=1>
>   <dtml-field input="submit" caption="Done">
> </dtml-form>
> 
> Any info on how to define your own custom dtml-tags *in python* would be
> highly appreciated. Anyhow, if the functionality I'm looking for is somehow
> allready available I'll consentrate on something else.
> 
> Best regards,
> Thomas Weholt
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )