Help with asynchronous request script

Asked

Viewed 67 times

0

This form will have the purpose of scheduling for consultation, with the client selecting the desired professional, and having a calendar with the weekly days selectable for service.

For example:

Dr Rogério meets from Monday to Saturday.

But Dr Ludmila attends only the 3rd and 5th

Till then it’s all working wonders.

My problem is in the exchange (in a new selection) of professionals.

When I select Dr Ludmila and visualize her attendance calendar, but when I try to change it to Dr Rogério’s calendar by making a new professional selection, he keeps bringing me Dr Ludmila’s calendar.

I can only change the calendar giving an update on the page, and redoing the whole procedure and selecting Dr Rogério, to load your calendar

Post that address temporary to view the problem, with a link to the Download of used records.

If friends can give me a light, how can I change the calendars before the selection of the professional without having to reload the page, I will be very grateful.

Thanks in advance for your attention.

1 answer

1


Inside your calendar.php file Add the following line $("#datepicker").datepicker("destroy");

your code will look like this

<script>
    $(document).ready(function(){
            $("#datepicker").datepicker("destroy");
            $("#datepicker").datepicker({
                beforeShowDay:function(date)
            {
            var day = date.getDay();
            var month = date.getMonth();
            var currDate = date.getDate();
            '.$datepicker['formato_calendario'].'
            {return [false];}
            else
            return [true];

        }});
    });
</script>

What is happening is that you already have a datapicker instance and are trying to add another, but for that you need to destroy the current

  • Thanks Marcos Brinner , I just had to change from class(.) to id(#), and it worked perfectly. Thank you for your attention to my problem. See the result at the provisional address - (https://www.pbfjacarepagua.com.br/calendario/), Hugs.

  • now yes, that good q gave, I will edit reply :) if you can mark it as correct just click on

  • Thanks Marcos Brinner, I already marked as Useful your reply. And as you must have already checked at the provisional address, I am removing it. Thanks again for the help,

Browser other questions tagged

You are not signed in. Login or sign up in order to post.