| 1. Multiple submit buttons on the same page and submit with "Enter".
| Problem: Browsers have undefined behavior with regard to multiple submit
| buttons on the same form.  Some of them provide the name=value pair of
| the first submit button of the form some don't provide any name=value
| pair of the submit buttons.

That's weird. If a form was submitted, the relevant submit button should
show up in the fields. I've never seen this. Can you tell me a little more?


| 2. Unable to use JavaScript to define the _action_methodName style
| actions.

Why not just use multiple submit buttons? Barring that, you could have the
value of _action_methodName be something like "save" or "delete" or
whatever, and do your logic inside of servlet.methodName().

Also, you don't have to use forms to use actions. We've got all kinds of
stuff running that takes advantage of actions with plain old links:

<a href="foo.py?_action_delete=1">Delete</a>

With some clever stylesheet stuff, you can even make them look like buttons
(doing this a lot here). And, you can certainly change the href with
javascript, or have the href itself be a script function.

If you HAVE to use forms (even POST submit types) just do this:

- put an "onClick()" on the submit button
- triggered from that event, change the target action of the relevant <form>
tag to
   "target?_action_someArbitraryAction=1"
- run myform.submit() from your script.

Bingo. I do this a lot, too.

By the way, if you're interested in forms and webware, check out either Ian
Bicking's "FunFormKit" http://funformkit.sourceforge.net/ or my own
"FormKit" http://dalchemy.com/python/formkit.

| Proposal:
| [...]

The problem with the "old" way is that one would then have to put the value
of a submit button as the action to be called. Unfortunately, HTML wants the
"value" of the submit button to be what effectively is the button label. SO,
what if you wanted your button to be [ Make a new Sailboat ]? Obviously,
that's not a valid python methodname.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to