Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Can't Load Date Control Error

Can't Load Date Control Error

Scheduled Pinned Locked Moved Web Development
htmlhelpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kKamel
    wrote on last edited by
    #1

    Hey there: i have this calendar control i used to put a html text box and an image and on click event on image a pop up calendar appears. Now when i removed the image and i added it to html textbox onclick event it gives me an error stating Can not load Date Control. Please Could any one tell me why and if there is any solution??

    A 1 Reply Last reply
    0
    • K kKamel

      Hey there: i have this calendar control i used to put a html text box and an image and on click event on image a pop up calendar appears. Now when i removed the image and i added it to html textbox onclick event it gives me an error stating Can not load Date Control. Please Could any one tell me why and if there is any solution??

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      There is no way one can help you without seeing what code it ran during the click of the picture or onclick of the textbox. Please let us know what calendar control you are using, and how this is rendered. :zzz:

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      K 1 Reply Last reply
      0
      • A Abhishek Sur

        There is no way one can help you without seeing what code it ran during the click of the picture or onclick of the textbox. Please let us know what calendar control you are using, and how this is rendered. :zzz:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        K Offline
        K Offline
        kKamel
        wrote on last edited by
        #3

        <td>
        <input type="text" id="txtStartDate" runat="server" style="width: 160px"
        onkeypress="return DisableSpecialCharactersWithLength(this,event,false,false,false,0)"
        onclick="javascript:popUpCalendar(this,'<%=txtStartDate.ClientID%>','mmm dd yyyy')" />
        </td>
        <td style="padding-top: 2px">
        <img alt="" id="img2" style="cursor: pointer" border="0" src="../../Images/calendar.gif"
        onclick="javascript:popUpCalendar(this,'<%=txtStartDate.ClientID%>','mmm dd yyyy')" />
        </td>

        now the input in the first TD has the error becuase i added popcalendar on onclick event , but when i remove it and i use the image onclick event having the same code then it works fine, it is really confusing me guys, even if i changed onclick event on the text box to on focus, on blur ....

        A 1 Reply Last reply
        0
        • K kKamel

          <td>
          <input type="text" id="txtStartDate" runat="server" style="width: 160px"
          onkeypress="return DisableSpecialCharactersWithLength(this,event,false,false,false,0)"
          onclick="javascript:popUpCalendar(this,'<%=txtStartDate.ClientID%>','mmm dd yyyy')" />
          </td>
          <td style="padding-top: 2px">
          <img alt="" id="img2" style="cursor: pointer" border="0" src="../../Images/calendar.gif"
          onclick="javascript:popUpCalendar(this,'<%=txtStartDate.ClientID%>','mmm dd yyyy')" />
          </td>

          now the input in the first TD has the error becuase i added popcalendar on onclick event , but when i remove it and i use the image onclick event having the same code then it works fine, it is really confusing me guys, even if i changed onclick event on the text box to on focus, on blur ....

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          I think as you are using Javascript calendar, in the code written over the function, it should be expecting an img to generate the click event. Check what is written inside the popUpCalendar function. Just adjust the code such that it would get the event from the textbox itself rather than the image. You can see from within PopUpCalendar, you pass this. In case of img, this represents the img object but in case of textbox it is input. These objects are completely different when you work using javascript. So you need to modify your code to support this... ... ;) Hope you can do that. :thumbsup:

          Abhishek Sur


          My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

          **Don't forget to click "Good Answer" if you like to.

          K 1 Reply Last reply
          0
          • A Abhishek Sur

            I think as you are using Javascript calendar, in the code written over the function, it should be expecting an img to generate the click event. Check what is written inside the popUpCalendar function. Just adjust the code such that it would get the event from the textbox itself rather than the image. You can see from within PopUpCalendar, you pass this. In case of img, this represents the img object but in case of textbox it is input. These objects are completely different when you work using javascript. So you need to modify your code to support this... ... ;) Hope you can do that. :thumbsup:

            Abhishek Sur


            My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

            **Don't forget to click "Good Answer" if you like to.

            K Offline
            K Offline
            kKamel
            wrote on last edited by
            #5

            Thanks a lot it helped and it worked, the problem was that i was searching for client Id of a control that was not created the moment i changed to this.id it worked fine. what helped that you told me that the problem is inside the script and when i did read the script i found that the error appearing was that it did not find the control iw ill mark your above answer as the solution.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups