Both are possible, but you'll have to write code to get this done.
- Add a date picker to your form and change its name to "date".
- Copy the isDay() function from
http://enterprise-solutions.swits.net/infopath/switch-day-sections-jscript-xdext
ensions.htm to your form's code.
- Add an OnValidate event for the "date" field to your form's code and then
add the following code to this event handler:
if (!isDay(5))
{
var objDate = XDocument.DOM.selectSingleNode("//my:date");
eventObj.ReportError(objDate, "Date must be a Friday", false);
return;
}
This code will prevent the form to be submitted unless the day is a Friday
and will show a red field validation error border around the "date" field and
a tooltip with the text "Date must be a Friday" whenever the user hovers with
the mouse pointer over the "date" field.
For more information on OnValidate and ReportError see
http://msdn.microsoft.com/library/en-us/ipsdk/html/xdevtOnValidate_HV01021372.as
p?frame=true
---
S.Y.M. Wong-A-Ton
> Hi, i'm new to infopath, i'm designing a simple timesheet form with a date
> picker control. I want users to always pick Friday of the week(any week). If
> user pick a date other than friday, it displays an error or something like
> that. or if this is not possible can I put default value of date control as
> Friday of the week.
> Thanks,
Gurmit - 02 May 2006 19:19 GMT
Thanks, this is a great help.

Signature
Gurmit Singh
> Both are possible, but you'll have to write code to get this done.
>
[quoted text clipped - 27 lines]
> > Friday of the week.
> > Thanks,