[albatross-users] setting value field

Sheila King sheila at thinkspot.net
Wed Jun 25 12:53:04 EST 2003


--On Tuesday, June 24, 2003 2:55 PM -0400 "Michael C. Neel" 
<neel at mediapulse.com> wrote:

> In my apps I use the name of the submit button to control flow, using
> the ctx.req_equals().
>
> Normally looks something like:
>
> 	if self.page = "mystuff/form.html":
>
> 		if ctx.req_equals("saveme"):
> 			#save the record
> 		elif ctx.req_equals("delme"):
> 			# delete the record
> 		etc....
>
> Note: if you us images for sumbit buttons, then you nees to do
> ctx.req_equals("saveme.x") - I'm not sure if that's still true in
> 1.10pre1

It is interesting to see how different people are handling these types of 
things.

I've just been doing something like this:

if ctx.has_value('submit'):
    # do the submit stuff
elif ctx.has_value('cancel'):
    # do the cancel stuff

etc...

Where 'submit' or 'cancel' or what have you is the name of the submit-type 
form element.

I don't see any downside to this technique?


-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org




More information about the Albatross-users mailing list