views:

544

answers:

1

I'm new to the javascript and web development scene so bear with me. On a website I'm programming for, I have a table filled with date values from a server side source. Upon clicking a section of a table, the text will be replaced by a input textbox that contains the date that was clicked on(applying a mask) and when the textbox appears, a jquery datepicker box is supposed to appear so the date can be edited. Is the applying of the datepicker to a masked textbox possible in this situation. If so, how would you go about doing this? ?

A: 

It is possible to have date picker and mask for date on the same text box you can use both jQuery mask and jQuery date picker. On the click event put focus on text box that is appearing and datepicker will expand.

jQuery(document).ready(function() {
     jQuery(".classOfTextbox").datepicker(
        {
            changeMonth: true,
            changeYear: true
        });
     $(".classOfTextbox").mask("99/99/99;");

   $('table').click(function(){
      $(".classOfText").hide();
      $(".classOfTextbox").show();
      $(".classOfTextbox").focus();    
   });    
}

do not forget to put style display:none for .classOfTextbox and to include all .js and .css files needed for jQuery

SonOfOmer