Jump to content

Show Message based on previous selected item


eagleman

Recommended Posts

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

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

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...