eagleman Posted June 24, 2022 Share Posted June 24, 2022 hello, can you please help me to find a solution please https://github.com/surveyjs/survey-library/issues/4492#issue-1281220580 Link to comment Share on other sites More sharing options...
Prestachamps Posted June 24, 2022 Share Posted June 24, 2022 Hi, you should sent to the template your two messages (to a JavaScript array), and using JavaScript display the one which is needed, according to the selected Radio button/option. I hope that I could help. Have a nice day, Leo. 1 Link to comment Share on other sites More sharing options...
eagleman Posted June 24, 2022 Author Share Posted June 24, 2022 Hello @Prestachamps I appreciate your help and thank you for your time. any example please or guide regards Link to comment Share on other sites More sharing options...
Prestachamps Posted June 24, 2022 Share Posted June 24, 2022 Hi @eagleman, something like this: <script> var my_date_aray = [];{/literal} {foreach from=$orders item=order} my_date_aray["{$order.details.reference}"] = "{$order.details.order_date}"; {/foreach} {literal} </script> After this you can use the value by referring the array with the order reference as key, taken from the selected radiobutton. Have a nice day, Leo. Link to comment Share on other sites More sharing options...
eagleman Posted June 25, 2022 Author Share Posted June 25, 2022 (edited) Hi @Prestachamps thank you very much, i will investigate more because it does not work , the alert console shows en emy message http://pastebin.fr/107681 Edited June 25, 2022 by eagleman (see edit history) Link to comment Share on other sites More sharing options...
eagleman Posted June 28, 2022 Author Share Posted June 28, 2022 Hi @Prestachamps I can seed now the orders in log with date, but i do not how to use the value by referring the array with the order reference as key, taken from the selected radiobutton. Regards Link to comment Share on other sites More sharing options...
Prestachamps Posted July 1, 2022 Share Posted July 1, 2022 Hi @eagleman, try debugging the variable with console.log() to see if there are correct keys in the variable: {foreach from=$orders item=order} my_date_aray["{$order.details.reference}"] = "{$order.details.order_date}"; {/foreach} {literal} console.log(my_date_aray); alert("the order = "+ my_date_aray); and then in the json assignment you should use the corresponding key assignment : "html":"date " + my_date_aray["{/literal}{$order.details.reference}{/literal}"] Hope I can help, Have a nice day, Leo. Link to comment Share on other sites More sharing options...
eagleman Posted September 28, 2022 Author Share Posted September 28, 2022 Hi @Prestachamps the variable load all dates, so please I need to show only the date of the selected order could you please help me find what is wrong https://watch.screencastify.com/v/0qhxBORv5xeA1xbGCOyE http://pastebin.fr/109889 Regards list.tpl Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now