Jump to content

Display date of order based on selected jQuery


eagleman

Recommended Posts

0

I'm trying to get the date of selected order from a dropmenu and to display an iput, using smarty into jQuery.

But I'm getting all dates

 

  {literal}  
                    <script type="text/javascript">
                var my_date_aray = [];{/literal}
                {foreach from=$orders item=order}
                    my_date_aray["{$order.details.reference}"] = "{$order.details.order_date}";     
                {/foreach}
                {literal}
                    $(document).ready(function(){
                        $('#queryRef').on('change',function(){
                            //var optionValue = $(this).val();
                            //var optionText = $('#dropdownList option[value="'+optionValue+'"]').text();
                            //var optionText = $("#queryRef option:selected").text();
                            var input = document.getElementById("reference");
                            $('#reference').val(my_date_aray);
                            var queryRef = $("#queryRef option:selected").val();
                            if (queryRef == 0) {
                                $("#createTicket").attr("disabled", true);
                                    
                                }
                        });
                        });
                    </script>
                {/literal}

 

Link to comment
Share on other sites

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...