[Zope] button in ZPT

J Cameron Cooper jccooper at jcameroncooper.com
Fri Aug 8 16:50:01 EDT 2003


>
>
>Instead of a textlink I want to use a button (form) as a replacement for the
>following statements.
>Has anyone suggestions ?
>
>    <a tal:condition="previous"
>       tal:attributes="href
>string:${request/URL0}?start:int=${previous/first}"
>       href="previous_url">previous</a>
>  
>
It's a very basic HTML/HTTP idiom::

<form method="get" action="previous_url" tal:condition="previous" 
tal:attributes="action request/URL0">
  <input type="hidden" name="start:int" value="somedefault" 
tal:attributes="value previous/first" />
  <input type="submit" name="Submit" value="previous" />
</form>

One could also do the slightly more compact but less clever::

<form method="get" action="previous_url" tal:condition="previous"
  tal:attributes="action 
string:${request/URL0}?start:int=${previous/first}">
  <input type="submit" name="Submit" value="previous" />
</form>

          --jcc

-- 
"My point and period will be throughly wrought,
Or well or ill, as this day's battle's fought."





More information about the Zope mailing list