0

Hi,

I am trying to load u sub-page wich has 2 datepickers but i can't get them to work.

This is the code on my main page

 <script>   
            $(function(){
                $("#datepicker").datepicker();
            });

           //function is called onchange in a list
            function loadTherapie(){
                var therapieID = document.getElementById("lijstTherapieen").value;
                $("#divTherapie").load("wijzigtherapiesubpage.php?therapieID="+therapieID+"&cacheOntloper="+randomNumber()+"&type=2", function(response){
                   $(response).find("#datepicker").datepicker();
                });
            }
</script>

And on my sub-page I have this

<form method="post" action=test.php name="therapie">     
        <input class='datepicker' type='text' name='txtdatumOpmaak' value='<?php echo "$opmaakdatumAangepast";?>'></input>     
        <input type='text' class='datepicker' name="txtdatumEvaluatie" value='<?php echo "$evaluatiedatumAangepast";?>'></input>        
</form>

I am not sure but I think that I have to reactivate the jQuery on my sub-page but I have the feeling that the $(response).find("#datepicker").datepicker(); doesn't work.

1
Contributor
1
Reply
11
Views
2 Years
Discussion Span
Last Post by nevek
0

Solved it

The loadTherapie function need's to be like

function loadTherapie(){
                var therapieID = document.getElementById("lijstTherapieen").value;
                $("#divTherapie").load("wijzigtherapiesubpage.php?therapieID="+therapieID+"&cacheOntloper="+randomNumber()+"&type=2");
                $(".datepicker").datepicker();
            }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.