Page 1 of 1

right way to add several buttons/tasks

Posted: Tue Feb 21, 2012 10:23 am
by mtrivino
Hello everyone,

I want to have a form that calls a different method depending on what button is pressed, and I was wondering what would be the right way to do something like this. Should I try changing the task value via javascript or should I try something else?

Cheers,

M.

Re: right way to add several buttons/tasks

Posted: Tue Feb 21, 2012 2:01 pm
by popa alexandru
Easiest way is the second method, parse the task value via javascript by adding an onclick event to your buttons, something like onclick="document.adminForm.task.value='controllername.yourtask'", place the yourtask function inside controller and should work just fine.

Re: right way to add several buttons/tasks

Posted: Fri Feb 24, 2012 2:09 pm
by mtrivino
Thanks, I'll give it a try.

Regards,

M.