This is a bit tricky but doable.
The easiest would be to set the fromat of the datepicker to this representation of the date (e.g. Wednesday, March 14, 2007). Then you could check if there is "Saturday" or "Sunday" within the text of the xml node and then handle the wrong selection of the user. However this is not possible as the internal representation of a date is always 3/14/2007 for the above mentioned date.
But there is a little workaround. I guess you have a Submit button on your form so double click it and select "Edit code". Now you can use the following code to check if some wrong day was selected (code is in C#):
//store the selected date into a temp variable
string tmp = thisXDocument.DOM.selectSingleNode("my:myFields/my:datepicker").text;//convert the date string stored in your temp variable to the date format you need to do the check
string tmp = thisXDocument.DOM.selectSingleNode("my:myFields/my:datepicker").text;//convert the date string stored in your temp variable to the date format you need to do the check
//convert the date string stored in your temp variable to the date format you need to do the checkstring convertedTime = Convert.ToDateTime(tmp).ToString("dddd, MMMM dd yyyy");//get only the day fromt the complete date (Wedenesday, March 14, 2007)
string convertedTime = Convert.ToDateTime(tmp).ToString("dddd, MMMM dd yyyy");//get only the day fromt the complete date (Wedenesday, March 14, 2007)
//get only the day fromt the complete date (Wedenesday, March 14, 2007)string day = convertedTime.Substring(0, convertedTime.IndexOf(","));//check if the selected day is either a Saturday or Sunday
string day = convertedTime.Substring(0, convertedTime.IndexOf(","));//check if the selected day is either a Saturday or Sunday
//check if the selected day is either a Saturday or Sundayif(day == "Saturday" || day == "Sunday"){
//empty the datepicker control again
if(day == "Saturday" || day == "Sunday"){
//empty the datepicker control again
//empty the datepicker control againthisXDocument.DOM.selectSingleNode("my:myFields/my:field3").text = "";
//show message to the user that he/she did a wrong selection
//show message to the user that he/she did a wrong selectionthisXDocument.UI.Alert("You are not allowed to select a Saturday or Sunday ! Please make a new selection.");
}
Let me know if this helps you !?!