Hi,
In https://www.chronoengine.com/faqs/74-chronoforms6/5289-variable-shortcodes, it is said that :
The variable value is available ONLY AFTER the function has been processed.
OK, but when is the function evaluated ? After something has been typed in, say the text-field, and after the focus went to another field ? So, should I be able to display that return value in a button for example ?
Does Ajax has something to do with that ?
As you can see I'm an absolute beginner like in the song🙂
Cheers,
jc
Hi JC,
No, functions here are event actions and they run when the form is loaded or submitted, so the var is available during the load/submit routines.
If you want to do something on a button click then you need a field event and you will need to use JavaScript to write the code, but if you will do some server side task then you can also use AJAX and call a form event to do the processing, for example the field "reload" event uses AJAX as explained in the manual.
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi JC,
The dynamic dropdown demo form is not working for you out of the box without any changes ?
You can use the same "reload" event to reload a button with the new content or reload a whole area, this can be done.
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi,
sorry for my late response...
Yes the demo worked fine out of the box. But when you haven't chosen something in the 1st, there's nothing in the second. May be it could display "Choose something in the 2st menu". And, if you choose say "So so" and then choose the "?" again , display that message ("Choose something in the 2st menu") again.
About "reload", there is no Advanced -> Reload Event in the button edition page. So how to do that in the same way as for the dropdown menus ?
Thanks for your response,
jc
Hi JC,
You can add a default empty option to the 2nd dropdown:
=Please choose something from the first dropdown
You may also return this empty option when the first dropdown choice i empty.
I have added the reload event for buttons on the todo list
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.