Forums

CF6 create a double flag to activate submit button

prince25 22 Jan, 2019
Hi,
sorry for my inexperience.
I'm realizing an acceptance form in CF6.
We must do n. 2 acceptance with flag or selection by drop-down Yes / No, for which it is not possible to activate the event tabs for a final action: enable / disable the submit button, but you must add the two acceptances.
I thought about creating a PHP options with the different possibilities.
Question:
can you help me to write PHP to activate / deactivate the submit button?
To make effective the return of the PHp options I use a custom code to direct it to the submit button? with what syntax?
Reference elements:
1 dropdown: field_select1 => choices: n = No, y = Yes
2 dropdwon: field_select2 => choices: n = No, y = Yes
Many thanks for the time you dedicate to me
Max_admin 22 Jan, 2019
Hi prince,

You want to have the submit button in a different page ? if so then you can build a multi page form.

How the n2 acceptance should work exactly ?

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
prince25 22 Jan, 2019
Hi admin,
I send you a screenshot
prince25 22 Jan, 2019
To activate the submit button both "Yes" are required
Max_admin 22 Jan, 2019
Ok, when the form loads, both the bottom dropdown and button will be disabled ? you can enable the dropdown first then enable the button using the just enabled dropdown

Best regards,
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
prince25 22 Jan, 2019
when the form is loaded the drop-down menus are enabled (and validation is required - mandatory head); the button will be disabled.
with the confirmation of both the drop-down menus (Yes) the button is enabled.
No other combination of pull-down menus other than Yes for both enable the button
Best regards,
Max_admin 22 Jan, 2019
And you want both of the dropdowns set to yes to enable the button, correct ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 22 Jan, 2019
So I think that you should keep the button and the dropdown disabled, enable the 2nd dropdown after the first one is set to yes, and enable the button with the 2nd dropdown.

Best regards,
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
prince25 22 Jan, 2019
It is the first solution I have adopted.
Not good has this drawback: if after doing the whole sequence you indicated, I choose in the first menu No, the button remains active and the second menu is disabled.
It is necessary a logical connection between the choices of the two menus that for example I believe can be done by inserting an element Php options, sending the return of the Php to the button.
I'm not sure why not very experienced ... and I do not know what syntax to adopt for the code.
healyhatman 22 Jan, 2019
ALSO disable the button in the dropdown1 event when selecting No. Better yet, set both dropdowns to "required" and in your options list put
=No
1=Yes
That way if they select "no" then it's not a VALUE (only has the label) and they won't be able to submit the form.
This topic is locked and no more replies can be posted.