[ZPT] Re: Action

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Wed, 19 Mar 2003 16:52:29 +0100


Godefroid Chapelle wrote:
> Tom Deprez wrote:
>> Hi,
>>
>> How do most of you handle the usage of the action parameter with
>> multiple submit buttons in a form with ZPT?
>> Or what are the alternatives you use?  One python script which looks
>> for some information to determine which action is needed?
>>
>> Thanks,
>> Tom.
> Hi Tom,
>
> I am not sure what you are looking for. I am using the value attribute
> of <input type="submit> as in DTML.

Something like this:

----
<form action="employeeHandlers">

<p>Select one or more employees</p>

<input type="checkbox" name="employees:list" value="Larry"> Larry<br>
<input type="checkbox" name="employees:list" value="Simon"> Simon<br>
<input type="checkbox" name="employees:list" value="Rene"> Rene<br>

<input type="submit" name="fireEmployees:action"
value="Fire!"><br>

<input type="submit" name="promoteEmployees:action"
value="Promote!">

</form>
---

Depending on the submit button another pythonscript is called. At the
moment, I give that input type a name="action" and depending on the value of
'action' I decide which python script to perform. But perhaps there was a
better one, like we could do in DTML (as above)

> BTW How is your job ?

I have had several meetings on the subject already. For them it's cleared
out, for me it's still not cleared out. I need some other meetings to do
before I think it is cleared.

Tom.

>
> BubbleNet sprl
> rue Victor Horta, 18 / 202
> 1348 Louvain-la-Neuve
> Belgium
>
> Tel + 32 (10) 459901
> Mob + 32 (477) 363942
>
> TVA 467 093 008
> RC Niv 49849
>
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://mail.zope.org/mailman/listinfo/zpt