ITPDateQuestion

A descendant of ITPQuestion, representing a date question on a form. Associates a date picker control with the input field. Implements some simple date validation, to be extended and improved. Makes sure all screen representation is done in a screen representation format, whereas internal representation remains in the ITP XForms format.

constructor

ITPDateQuestion

Trivial

public methods

-

overrides

initScreenElements()

Transforms the simple input field, which will still be used to post the internal answer, to an input with fixed size and associated JQuery classes. Binds the method applyScreenAnswer to the events onkeyup and onblur. Makes sure a correct dateControlMask will be used; array which determines the order in which the elements of the date should be shown. Note that the locale specific masks are defined in the language specific resources \[lan].js files e.g., en.js, nl.js.

setInternalAnswer(pAnswer)

Sets the internal answer, which should be in the XForms format, both in the local variable and in the hidden input control.

getScreenAnswer()

Returns the screen answer in ITP format.

setScreenAnswer(pAnswer)

Converts pAnswer from ITP to screen format and applies it to the screen. Associates a date picker with the control, if this hasn't already been done.

validate(pAnswer)

Validates a date value.

other methods

ITP_to_screen(pITPAnswer)

Converts an ITP format answer to screen format.

Screen_to_ITP(pScreenAnswer)

Converts an screen format answer to ITP format.

setDateAnswer(dateText, inst)

Callback function for the date picker widget.

getDateFormat(pMask, pSeparator)

Transforms an old array dateControlMask to a date format string.