javascript - JQuery DatePicker Multiple Input -


using jquery , asp.net c#3.0.

i have following script:

<script>   $(document).ready(function () {       $("[id$=txthiddendate]").datepicker({           showon: "button",           buttonimage: "../../images/calendar-icon.gif",           buttonimageonly: true       });   }); </script> 

there 3 separate fields day month , year.(txtday, txtmonth, txtyear) how return date these 3 separate fields?

many thanks!

edit: want keep hidden field aswell

html

setups other inputs hold pieces of date. may want make these hidden.

<input id="picker"/><br> day: <input id="day"/><br> month: <input id="month"/><br> year: <input id="year"/> 

javascript

specifies onselect function parses different pieces of date , assigns them respective inputs.

 $(document).ready(function () {       $("#picker").datepicker({           showon: "button",           buttonimage: "../../images/calendar-icon.gif",           buttonimageonly: true,           onselect: function(strdate){              var tokens = strdate.split("/");               $("#day").val(tokens[1]);               $("#month").val(tokens[0]);               $("#year").val(tokens[2]);            }       });   }); 

js fiddle: http://jsfiddle.net/9ww8g/


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -