> Suggestion: Isn't it better to add another parameter instead of clogging
> cocoon-action? I mean:
>
> Instead of:
> <input type="submit" name="cocoon-action-Add/parametervalue"
> value="Add">
>
> Have:
> <input type="submit" name="cocoon-action-add" value="Add">
> <input type="hidden" name="cocoon-action-parameter"
> value="parametervalue">
>
> Hope it fits into your applications as well as
> "cocoon-action-Add/parametervalue" or even better.

That's true of course! This would be much nicer but will not work because
of same reason the hidden input example Carsten suggested will not work.
-> More than one submit button per form.

Anyway, I already implemented the new syntax (just haven't yet commited it
yet) but left out the parameter stuff. (need to get my webapp running with
all the new stuff to try it out ;)

But you gave me an idea... what about this:

  <input type="submit" name="cocoon-action-add" value="Add">
  <input type="hidden" name="cocoon-action-add-parameter" value="parametervalue">

Note that name is the same as the submit button's plus a postfix.
Cool! This does not even need a change in single line of code....
The action only have to know it's "name" or key

Sometimes it's that simple you don't see it :)
--
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to