Forums

Multi submit buttons

Groris 25 Apr, 2014
Hi, I've got a little problem, i've got a form with 2 submit butttons, i've download event Switcher [GH] but i don't know how to use it 😟
I'm very bad in php this is why i ask for help...

my 2 buttons are "inscription"(id:inscription) and "enregistrer et inscrire un autre"(id:saveAnother)

is this code correct ?
<?php $but = $form->data['event'];
switch ($but ) {
    case "Inscription":
        return 'event_a';
        break;
    case "saveAnother":
        return 'event_b';
        break;
    default:
        return 'event_d';
}
?>
Max_admin 27 Apr, 2014
Hi Groris,

Please give your 2 buttons the same name, say "test" (but not event), and then use your code!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.