Solved

how to use jquery datepicker

Posted on 2011-09-12
2
450 Views
Last Modified: 2012-05-12
Hello experts,

I am using this jquery datepicker.

http://docs.jquery.com/UI/Datepicker

and I need to grab the a single selected date in my ASP code. How do I do this? It's probably something simple that I just can't find.

<%response.Write "DatePicker: "&request.Form("#datepicker")&"<br>" %>

Open in new window

Thanks
0
Comment
Question by:dpicco
  • 2
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 36524472
use an hidden field to store the value for you :

<div id="datepicker"></div>
<input type="hidden" id="datepicker_value" name="datepicker" />


$('.selector').datepicker({
   onSelect: function(dateText, inst) { $("#datepicker_value").val( dateText ); }
});

check the onSelect event definition on this page : http://docs.jquery.com/UI/Datepicker#events

Test page (the hidden field is replace by a textbox to let you see the value) : http://jsfiddle.net/qJ3yg/1/
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36524491
$('#datepicker').datepicker({
   onSelect: function(dateText, inst) { $("#datepicker_value").val( dateText ); }
});
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…

860 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