onclick is not valid attribute of element DateInput

5 posts, 0 answers
  1. Tu
    Tu avatar
    3 posts
    Member since:
    Nov 2008

    Posted 19 Nov 2008 Link to this post

     My Rad version is Q1 2008 , when I use RadDatePicker , there's always a error that : "onclick is not valid attribute of element DateInput" , even I copy code example , it still have a same problem ... Can somebody help me resolve this. Thanks !
    My aspx code is below

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server"
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            </telerik:RadScriptManager> 
            <script type="text/javascript"
            function ToggleFirstPopup() 
            { 
                $find("<%= RadDatePicker1.ClientID %>").showPopup(); 
            } 
            </script> 
        <div> 
            <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="English (United States)" 
                SelectedDate="2008-11-19" Style="position: relative"
                <DatePopupButton Visible = "true" > </DatePopupButton> 
                 
                <DateInput onclick = "ToggleFirstPopup()" DateFormat = "D"
                 
                </DateInput> 
            </telerik:RadDatePicker> 
         
        </div> 
        </form> 
    </body> 
    </html> 
     
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 19 Nov 2008 Link to this post

    Hello Tu,

    Please try the following modification:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="English (United States)" 
        SelectedDate="2008-11-19" Style="position: relative"
        <DatePopupButton Visible="true"></DatePopupButton> 
        <DateInput ClientEvents-OnMoveDown="ToggleFirstPopup" DateFormat="D"
        </DateInput> 
    </telerik:RadDatePicker> 

    RadInput Client-Side Events

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Tu
    Tu avatar
    3 posts
    Member since:
    Nov 2008

    Posted 19 Nov 2008 Link to this post

    i have tried , but my RadDatePicker doesnt' show popup when running ...

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server"
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            </telerik:RadScriptManager> 
            <script type="text/javascript"
            function ToggleFirstPopup() 
            { 
                $find("<%= RadDatePicker1.ClientID %>").showPopup(); 
            } 
            </script>       
              
        <div> 
             
            <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="English (United States)"  
             SelectedDate="2008-11-19" Style="position: relative">  
        <DatePopupButton Visible="true"></DatePopupButton>  
        <DateInput ClientEvents-OnMoveDown="ToggleFirstPopup" DateFormat="D">      
        </DateInput>  
            </telerik:RadDatePicker>  
         
        </div> 
        </form> 
    </body> 
    </html> 
     

  4. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 19 Nov 2008 Link to this post

    Hello Tu,

    Please examine the following demo and let us know if you have more questions.
    DatePicker Customization

    Best regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Nov 2008 Link to this post

    Hi Tu,

    Try adding the onClick attribute to the DatePicker in the code behind and see if it is working.

    CS:
      RadDatePicker1.DateInput.Attributes.Add("OnClick", "ShowPopUp();");

    JS:
    <script type="text/javascript" > 
     
    function ShowPopUp() 
     $find("<%= RadDatePicker1.ClientID %>").showPopup(); 
     
    <script/> 


    Shinu.
Back to Top