Skip to content
Advertisement

After ajax call, date picker work but the formatting not

Below is the Ajax call in index.php

JavaScript

The piutang.php (inside the Ajax call) has the text box for the date-picker and also the script for the date picker.

JavaScript

After the call, inside the div with id:#pd,
I can see the text box of the date picker with the current date.
But it show the default format mm/dd/yyyy not dd M yy.

What I’ve tried so far is cut the script code in piutang.php,
then paste/insert the code inside Ajax success, right after $("#pd").html(msg),
but the result is the same thing, inside the div with id:#pd,
the text box show the current date with its default format mm/dd/yyyy.

How do I solve this ?
Thank you.

Advertisement

Answer

You need to initialize date picker one time with all settings:

JavaScript

This one is enough. Remove other one.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement