RichDatePicker vs. document.getElementById(...)

Discussion in 'ASP.NET 2.0' started by cool2000, Mar 30, 2007.

  1. I was able to load the RichDatePicker control onto a page. I click the button with the 3 dots and a calendar pops out with the current month. I am able to go to the next and previous months by clicking on the arrows. However, I'm getting a JavaScript error when I click the Month and Year link (top of calendar, center) saying that document.getElementById(...) is null or isn't an object. Small "fake" windows are supposed to open up that allows us to pick non-adjacent months and other years. This doesn't happen due to the JavaScript error.

    Is there a way to fix this? I've looked through the documentation and forums at RicherComponents.com on this RichDatePicker control and I'm not finding any luck finding solutions to this one. Please help!
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    You probably have the wrong version of the Javascript uploaded. Where did you get your component?

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. I'm using IE6 as my web browser to view my pages. I don't know if I can control (update?) my JavaScript version. If so, how do I do that? I'm also using Visual Web Developer 2005 Express, set up in such a way that anything I do and save is saved to the server in real time. I don't have the RichDatePicker control installed on my local machine, since I thought that referencing it (as given by the kb.discountasp.net) on the page containing it, is sufficient to get it to work. I'm using version RichDatePicker1.6 as indicated by the knowledge base.

    I don't know what to do, and I need to post dates that are years and years ago. Clicking the arrows to get to the month/years I need is too tedious and takes forever. Please help!
     
  4. I don't know if it's pertinent but the page I put the RichDatePicker control is a content page that uses a master page. Does the JavaScript get messed up (especially in naming (ID-ing)the elements on the page) when you put the RichDatePicker inside an <asp:content> tag?
     
  5. Putting the RichDatePicker within the <asp:content../> should be fine.Are you facing any kind of issues using it?

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  6. I don't know, but I suppose that putting the RDP inside ANY tag shouldn't mess up the JavaScript. I do know, though, that ASP.net's HTML rendering engine (is that what it's called) renames client ids. For example if you said

     
  7. Yes, that's true, but I don't have control of referring to the element. I can access ctl00_NavigationControl from my own JavaScript,not fromRichDatePicker's built-in JavaScript. In other words, I don't think that RDP's JavaScript took it into consideration that the ASP.net html renderer would rename the elements' IDs.
     
  8. Have you tried accessing the element by the new name i.e 'ctl00_NavigationMenu' [document.getElementById('ctl00_NavigationMenu') ] ?I believe it should be the same everytime it server control 'NavigationMenu' is rendered on the client side.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page