2 submits buttons, how to identify them to action

minakara 21 Sep, 2024

Hello,

I haven't found how to distinguish my two submit buttons to act differently depending on whether one or the other is clicked.

On the previous version, we could add a value to the button, on CF7 (Joomla4)  this is no longer the case (or I don't know how to do it)

has anyone encountered this problem before? and do you have a solution.

I can't use the button with link because I use checkbox (in Table list) that I get in my action.

Thank you in advance for your help

Minakara

simelas 06 Oct, 2024
Answer
2 Likes

Within the button : Behaviors => Interface => HTML Tag Attributes => Add custom HTML tag attribute => in the first field type : "value"   in the second field type the value you want  exemple "1"   select:  Override

S.

Max_admin 07 Oct, 2024

you may also use the button name and check if the name exists in the data, the name is there by default in v8, but for v7 you need to use the html attributes like simelas has shown!

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
minakara 07 Oct, 2024

Thank you for your response.

As I am still in V7 I used Simelas' solution:

Here is a complete example of use

Bouton Type=Submit "Ajouter" :

      add custom HTML Tag Attributes  :

  • Attribute name=value Attribute value=ajouter  (override)
  • Attribute name=name Attribute value=choix (override)

Bouton Type=Submit "Modifier" :

      add custom HTML Tag Attributes  :

  • Attribute name=value Attribute value=modifier  (override)
  • Attribute name=name Attribute value=choix (override)

In the end_page  the value is retrieved in a php module like :

echo $this->data['choix'];

You need to login to be able to post a reply.