ToggleDate()

2 posts, 0 answers
  1. Michael Tissington
    Michael Tissington avatar
    64 posts
    Member since:
    Nov 2007

    Posted 23 Nov 2007 Link to this post

    I'm trying to  create a generic ToggleDate function but I'm a little confused about how to pass in the ClientID of the control to popup

    <DateInput onclick="ToggleDate(??)" />

    How do I pass the ?? as a parameter?
  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 26 Nov 2007 Link to this post

    Hello Michael Tissington,

    You can use the following code:

    function ToggleDate (dateInputId) 
        { 
            var dateInput = window[dateInputId]; 
        } 

    And in the code-behind:

    public partial class _Default : System.Web.UI.Page  
        protected void Page_Load(object sender, EventArgs e) 
        { 
            DateInputLive.DateInput.Attributes.Add("onclick", "ToggleDate('" + DateInputLive.ClientID + "');");  
        } 

    I hope this helps, and let me know if you have further questions.

    Greetings,
    Pavel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top