Different actions upon form submission possible?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Different actions upon form submission possible?

Alexandre Paes
Hi again everyone,

I have a form and i wanted to have different actions being performed
upon form submission (i.e: 'save', 'apply', 'verify', etc...), i think
this is pretty easy to achieve by having different callbacks on
different submit buttons. The problem is that i didn't want to use
submit buttons but instead some anchors that i have up in the page in
some kind of toolbar. Is there someway to achieve this?

Thanks in advance for the help,

Alex Paes
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Different actions upon form submission possible?

Alexandre Paes
Ok, just answering myself,


I have achieved this by adding a hidden input field and then setting
this hidden filed value before submitting the form, then on the callback
for that element i validate the value and send delegate to the desired
method.

If anyone knows a better way to achieve this i'd be glad to hear it.


Alex Paes


Em 10/17/07 11:53 Alexandre Paes escreveu:

> Hi again everyone,
>
> I have a form and i wanted to have different actions being performed
> upon form submission (i.e: 'save', 'apply', 'verify', etc...), i think
> this is pretty easy to achieve by having different callbacks on
> different submit buttons. The problem is that i didn't want to use
> submit buttons but instead some anchors that i have up in the page in
> some kind of toolbar. Is there someway to achieve this?
>
> Thanks in advance for the help,
>
> Alex Paes
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Different actions upon form submission possible?

Lukas Renggli
In reply to this post by Alexandre Paes
> I have a form and i wanted to have different actions being performed
> upon form submission (i.e: 'save', 'apply', 'verify', etc...), i think
> this is pretty easy to achieve by having different callbacks on
> different submit buttons. The problem is that i didn't want to use
> submit buttons but instead some anchors that i have up in the page in
> some kind of toolbar. Is there someway to achieve this?

JavaScript. For example using an Scriptaculous something along this should work:

html anchor
    onClick: (html evaluator
       triggerFormNamed: 'formId';
       callback: [ :script |
          self validate; whatever; something.
          script refresh ]);
    with: 'validate'

Lukas



>
> Thanks in advance for the help,
>
> Alex Paes
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Different actions upon form submission possible?

Alexandre Paes
Thanks Lukas,

I keep forgetting about ajax since i'm not used to using it all that
much. This way i can easily deploy many different actions.

Maybe you can help me with some other Ajax doubt.

I have several containers expanded by an SUEffect. Is there a way to
have an Evaluator be applied to these containers, but only to expanded
ones (by testing visible for instance)? I think i can achieve this
relatively easily but only performing one Ajax request per container,
since the callback would be the same, would there be a way to do this
with a single request?


Thanks for all the help,

Alex Paes


Em 10/17/07 13:11 Lukas Renggli escreveu:

> JavaScript. For example using an Scriptaculous something along this should work:
>
> html anchor
>     onClick: (html evaluator
>        triggerFormNamed: 'formId';
>        callback: [ :script |
>           self validate; whatever; something.
>           script refresh ]);
>     with: 'validate'
>
> Lukas
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside