DatePicker Input Mask

DatePicker Input Mask

I am using the Jquery date picker. I have a page where the user can enter a date. I want to make sure when they enter a date it will show up __/__/____ when they type it in. I have 3 date pickers on the page I want to mask. All 3 are the same lay out.

My Code 

  1. <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
  2. <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />


  3. <link rel="stylesheet" href="css/redmond/jquery.ui.all.css">
  4.     <script src="js/jquery-1.7.2.js"></script>
  5.     <script src="js/jquery.ui.core.js"></script>
  6.     <script src="js/jquery.ui.widget.js"></script>
  7.     <script type="text/javascript" src="js/jquery.ui.datepicker.js"></script>
  8. <script src="js/jquery.ui.button.js"></script>
  9.   <script src="js/jquery.ui.position.js"></script>
  10.        <script src="js/jquery.ui.autocomplete.js"></script>
  11. <script type="text/javascript" src="js/validate.js"></script>
  12. <script type="text/javascript" src="js/currencyFields.js"></script>
  13. <script type='text/javascript' src='js/dFilter.js'></script>
  14. <script language="JavaScript" src="js/mm_menu.js"></script>


  15. <link rel="stylesheet" type="text/css" href="css/subModal.css" />    
  16. <script type="text/javascript" src="js/common.js"></script>    
  17. <script type="text/javascript" src="js/subModal.js"></script>

  18. <script>
  19. $(function() {
  20. $( "#datepicker" ).datepicker({
  21. changeMonth: true,
  22. changeYear: true
  23. });
  24. });

  25. $(function() {
  26. $( "#datepicker1" ).datepicker({
  27. changeMonth: true,
  28. changeYear: true
  29. });
  30. });

  31. $(function() {
  32. $( "#datepicker2" ).datepicker({
  33. changeMonth: true,
  34. changeYear: true
  35. });
  36. });

  37. </script>

  38. <body>
  39.       <input type="text" name="datepicker" id="datepicker" onchange="getTerm();" onblur="checkDate(this)" value="<cfoutput>#DateFormat(TheCurrentDateTime,"mm/dd/yyyy")#</cfoutput>"/>
  40. </body>

I saw some examples online that about masking but every time I try them they never seem to work. When I debug in IE it says the mask is undefined.
I have also tried
  1. $(".datepicker").mask("99/99/9999;");
everywhere that I can think of and I can't get it to work. I am fairly new to jquery so I am still trying to understand the functionality of it.

Thanks