Calendar

RSform!Pro calendar field

RSForm!Pro uses YUI2 Calendar for this component with the following configurable tabs:

General

  • Name: the name of the form component. This needs to be unique for each form. It can contain only alphanumeric chars. The name of the field is only used for internal reference - it will not be displayed in the front-end area.
  • Caption: the caption or label is the text or HTML that is being displayed in the actual form.
  • Default value: the value will be automatically filled in when displaying the form. Inside the Default Value area you can use custom PHP codes in between the //<code> and //</code> tags.
  • Description: text/HTML area that provides a description of the field. This can be useful for providing explanations or indications for that particular field.

Validations

  • Required: you can choose to make the calendar mandatory.
  • Date Modifier: used to modify another calendar(within the same form) which will inherit the minimum or maximum possible date, based on what is selected in this calendar.
  • Date Offset: based on the above date modifier you can choose how many days to add or substract.
  • Date Validation: set this to Yes if you would like to validate the date upon submission based on the current date format.
  • Validation Message: here you can type your own validation message.

Attributes

  • Date format: the format of the selected date. By default d.m.Y is being used. Please see the PHP date() function for details on formats.
  • Min date: the submitter will not be able to select a date below or including the one specified here. As in the "max date" custom PHP codes can be used in between the //<code> and //</code> tags.
  • Max date: the submitter will not be able to select a date past or including the one specified in this field. Custom PHP codes can be used in between the //<code> and //</code> tags.
  • Note: If you want to allow the same date as well, when using the Date Modifier, use the Date Time Picker element instead (the time related functionality can be disabled from its configuration).

  • Calendar layout: Flat / Popup - controls how the calendar is displayed.
  • Readonly: Yes / No - If set to No the submitter can type in the date.
  • Popup label: if the Popup layout is being used, you can add the label of the button that triggers it.
  • Allow HTML: Setting this to Yes will not escape the HTML inside the button's label. Use this if you would like to place icons inside your button.
  • Additional Attributes: anything that is specified here will be reflected on the field that stores the date selection. For example: style="color:red" - this will make the color of the selected date red.

Examples:
  1. The Date Modifier validation allows calendars to be connected between each other. Using the modifier you can control the date selection of one calendar based on another.
  2. Code to prevent the user from selecting a date before today in the Calendar field placed inside the "Min date" field:

    //<code>
    return date('m/d/Y');
    //</code>


19 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that

You Should Also Read

Dropdown HOT

Checkbox Group HOT

Hidden Field HOT

Radio group HOT

Submit Button HOT