Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
Set value to today at client side
posted

Hi  Friends ,

I have a button  "Clear" when i clicked it it should set the value of datechooser to today's date.

This should be done at client side .

Please sen d the code for this  ASAP.

Thanks in advance

Regards,

Phani 

 

 

 

  • 28407
    posted

    HI Phani,

    here the code to do that:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

    <%@ Register Assembly="Infragistics2.WebUI.WebDateChooser.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
        Namespace="Infragistics.WebUI.WebSchedule" TagPrefix="igsch" %>

    <!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>
    <script language="javascript" type="text/javascript">
    // <!CDATA[
    var dchooser = null;
    function Button1_onclick() {
    //debugger;
    var dt = new Date();
     dchooser.setValue(dt);
    }

    // ]]>


    function WebDateChooser1_InitializeDateChooser(oDateChooser){
     //Add code to handle your event here.
     dchooser = oDateChooser;
    }
    // -->
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <igsch:WebDateChooser ID="WebDateChooser1" runat="server" OnInit="WebDateChooser1_Init">
                <ClientSideEvents InitializeDateChooser="WebDateChooser1_InitializeDateChooser" />
            </igsch:WebDateChooser>
       
        </div>
            <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
        </form>
    </body>
    </html>