If you need your visitors to pick a date in a form, use the calendar widgets. This makes it easier to locate the right date, and reduces the risk of errors considerably.

There are many situations where you may need a visitor to provide a date in one of the input fields of a web form. On the surface it may be adequate to use a simple text field for this, but unfortunately there are numerous data validation issues with date fields:

  •  There are three main date order styles in the world: day month year, year month day and month day year.
  • The day, month and year components can be separated by numerous different date separators like period, comma, forward slash, space or other special characters.
  • The year can be represented with only two digits, but it may not be obvious how to determine the right century from the two-digit year.
  • The last day in a month is either numbered 28, 29, 30 or 31.

And there’s probably more you need to think of, to properly validate a date that has been entered free-form in a text field. What date is 09-10-11? Let’s just say that using text fields for dates is a bad idea.

Calendar widgets

To help solve this problem, SpreadsheetConverter provides two different kinds of Calendar widgets. If you use one of these widgets, you will make it much easier for the user to pick the right date, e.g. since the calendar also shows weekdays. A calendar also makes it easier to count from one date to another. The widgets ensure that any date picked from the calendar is valid, and formats it correctly for the recipient of the electronic web form using the regional settings.

The calendar widgets do not return the selected date as text. Excel stores dates as sequential serial day numbers so that they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900. The date returned by the calendar widgets is in the form of an Excel serial number.

You can pass data into any named field in a form by providing it in the link, e.g.


In the example above, the serial number for January 1, 2008 is sent from the link into a field named “date” in the form. If this field contains a calendar widget, it will open on January 1, 2008.


Calendar properties

Both Calendar widgets style share the same set of widget properties:

  • The Button calendar is represented by a plain text field with button in the form, and the Full calendar appears only when you press the button – and disappears again when you have selected a date.
  • The Pop-up calendar appears as a plain text field in the form, but once you have focus on the widget, the Full calendar appears – and disappears again when a date has been set.
  • Name your widgets if you want to pass data into them from the link to the form. As an example, if the link to the form contains an Excel serial day number (/form.htm?date=20376), it will be preserved by the form if your form has a field named date, and it will be forwarded with the form when the form is submitted for processing. The autosave process will normally save the latest value for all input fields. If you want the value in the link to override the autosaved value, you have to disable Browser Storage on the Workbook tab. For electronic forms it is also much easier to process the form if all input fields have names. You can name your fields in the widgets or give them cell names in Excel.


*The default value of a calendar field is empty. To provide a default date, enter a date or Excel day number into the cell.  If you enter a date it must be formatted according to your computer’s regional settings, so that Excel converts it into a serial number automatically.