Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hello everyone,
Here i have jquery for calendar and autocomplete textbox(using ajax).
but i gives following runtime error

JavaScript runtime error: Object doesn't support property or method 'dynDateTime'


What I have tried:

Coding for Calendar is as follows,

<link href="Styles/calendar-blue.css" rel="stylesheet" type="text/css" />
 <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.dynDateTime.min.js" type="text/javascript"></script>
<script src="Scripts/calendar-en.min.js" type="text/javascript"></script>

<script type="text/javascript">
     $(document).ready(function () {
         $("#<%=txtDOB.ClientID %>").dynDateTime({
             //        $("#TextBox2").dynDateTime({

             showsTime: false,
             ifFormat: "%Y-%m-%d",
             //            ifFormat: "%Y/%m/%d %H:%M",
             daFormat: "%l;%M %p, %e %m, %Y",
             align: "BR",
             electric: false,
             singleClick: false,
             displayArea: ".siblings('.dtcDisplayArea')",
             button: ".next()"
         });

         $("#<%=txtDOJ.ClientID %>").dynDateTime({
             //        $("#TextBox2").dynDateTime({

             showsTime: false,
             ifFormat: "%Y-%m-%d",
             //            ifFormat: "%Y/%m/%d %H:%M",
             daFormat: "%l;%M %p, %e %m, %Y",
             align: "BR",
             electric: false,
             singleClick: false,
             displayArea: ".siblings('.dtcDisplayArea')",
             button: ".next()"
         });

             });

     
</script>

this is working fine before adding autocomplete textbox code as follows

<link href="Styles/jquery-ui.1.8.1.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery.min.1.4.2.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui.min.1.8.1.js" type="text/javascript"></script>


<script type="text/javascript">
    $(document).ready(function () {
        SearchText();
    });
    function SearchText() {
        $(".autosuggest").autocomplete({
            source: function (request, response) {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "frmUserMaster.aspx/GetAutoCompleteData",
                    data: "{'location':'" + document.getElementById('<%=txtLocation.ClientID%>').value + "'}",
                    dataType: "json",
                    success: function (data) {
                        response(data.d);
                    },
                    error: function (result) {
                        alert("Error");
                    }
                });
            }
        });
    }
</script>


Both are working fine separate web pages but when i am going to add on same page then it gives above error.
Please help me.
Posted
Updated 5-Nov-17 13:39pm
Comments
Peter_in_2780 4-Nov-17 1:15am    
First thing I'd look at is why you have both js min 1.4.1 and 1.4.2. There's almost certainly some conflict between them.
SujataJK 4-Nov-17 1:23am    
thanks a lot @Peter_in_2780.
It solve my problem.
Karthik_Mahalingam 4-Nov-17 1:50am    
post it as solution

1 solution

When you combine the two, you will have two conflicting versions of jquery (1.4.1 and 1.4.2). Remove one of them.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900