right way to add several buttons/tasks

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
User avatar
mtrivino
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 19, 2009 9:47 pm
Location: Bogotá, Colombia
Contact:

right way to add several buttons/tasks

Postby mtrivino » Tue Feb 21, 2012 10:23 am

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.

User avatar
popa alexandru
Joomla! Intern
Joomla! Intern
Posts: 63
Joined: Sun Sep 05, 2010 7:33 am
Contact:

Re: right way to add several buttons/tasks

Postby popa alexandru » Tue Feb 21, 2012 2:01 pm

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.
Joomla! Extensions
http://www.beesto.com

User avatar
mtrivino
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Aug 19, 2009 9:47 pm
Location: Bogotá, Colombia
Contact:

Re: right way to add several buttons/tasks

Postby mtrivino » Fri Feb 24, 2012 2:09 pm

Thanks, I'll give it a try.

Regards,

M.


Return to “Joomla! 2.5 Coding”

Who is online

Users browsing this forum: No registered users and 5 guests