This is a migrated thread and some comments may be shown as answers.

onclick is not valid attribute of element DateInput

4 Answers 105 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Tu
Top achievements
Rank 1
Tu asked on 19 Nov 2008, 04:35 PM
 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> 
 

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Nov 2008, 04:57 PM
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.
0
Tu
Top achievements
Rank 1
answered on 19 Nov 2008, 05:16 PM
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> 
 

0
Daniel
Telerik team
answered on 19 Nov 2008, 06:42 PM
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.
0
Shinu
Top achievements
Rank 2
answered on 20 Nov 2008, 05:57 AM
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.
Tags
Calendar
Asked by
Tu
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Tu
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or