[Zope] two submit buttons/ one method

Paul Winkler pw_lists@slinkp.com
Thu, 9 May 2002 07:32:16 -0700


On Thu, May 09, 2002 at 02:16:44PM +0100, Chris Withers wrote:
> John Hunter wrote:
> >=20
> > >>>>> "Geir" =3D=3D Geir B=E6kholt <geirh@funcom.com> writes:
> >=20
> >     Geir> <input type=3D"submit" name=3D"somevar" value=3D"someval" /=
>
> >     Geir> <input type=3D"submit" name=3D"somevar" value=3D"someotherv=
al" />
> >     Geir> </form>
>=20
> Could this be used instead?
>=20
>   <input name=3D"yourEditMethod:method" type=3D"submit" value=3D"Update=
 Form" />
>   <input name=3D"yourAddMethod:method" type=3D"submit" value=3D"Add Eve=
nt" />

I've done something similar (?) in the past:

<input name=3D"foo" type=3D"submit" value=3D"Foo Text" />
<input name=3D"bar" type=3D"submit" value=3D"bar Text" />

... and then in the (single) script handling form submissions,=20
I just tested for existence of foo and bar.  I forget exactly the=20
code I used to do that, but it was pretty easy.

In your version, where are yourEditMethod and yourAddMethod defined?
Are they acquired from somewhere? I smell a better solution than mine,
but I don't quite follow how this works...

--

"Welcome to Muppet Labs, where the future is made - today!"