Calendar control to paste a date into textbox via Javascript.

Posted on 2007-07-30
Last Modified: 2007-08-13
Hey all&

Ok, i have a <ASP:TextBox> and <ASP:Calendar> control on my page. OnSelectionChanged of the Calendar control I want to put the date value into the TextBox via Javascript as I do not want to do a postback on the page.

Is there any way of doing thins WITHOUT using AJAX?

Question by:Nugs
    LVL 8

    Accepted Solution

    LVL 2

    Author Comment

    sabeesh: i have seen this code in my search. and it is the exact idea i am looking to occumplish, with one exception. The calendar control and textbox are on the same page. SO even if i render cleint side script on the OnSelectionChanged ebent handler of the control, it still will need to post the back back... (maybe i am wrong)

    Essentially what i have in my ASPX code is this:
    <asp:TextBox ID="checkout" runat="server" Width="75" CssClass="form_objects"></asp:TextBox>
    <a href="#" onclick="showHideLayers('checkout_cal','','show')">
    <asp:Image ID="checkoutbutt0" runat="server" ImageUrl="~/images/cal.gif" AlternateText="Pick a Check In date" />
    </a><br />
    <div id="checkout_cal" style="position:absolute; z-index:1; display:none"><asp:Calendar ID="Calendar6" Width="50" runat="server"></asp:Calendar></div>

    How would i get the results from your link you posted if the textbox and calendar control is on the same page?

    LVL 2

    Author Comment

    Any further ideas on this?


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    In my daily work (mainly using, I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
    I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now