• No results found

Start PHPRunner. Now ip_address validation type is available in the list of validation types and you can use it in your projects

In document PHPRunner 8.0 Manual (Page 183-193)

How to add your own validation plugins

Step 4. Start PHPRunner. Now ip_address validation type is available in the list of validation types and you can use it in your projects

var regexp = /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/;

if(!sVal.match(regexp))

return 'This field should be a valid IP address';

else

return true;

}

Step 3. Store file ip_address.js to the <PHPRunner install folder>\source\include\validate folder. In our case the folder is C:\Program Files\PHPRunner8.0\source\include\validate.

Step 4. Start PHPRunner. Now ip_address validation type is available in the list of validation types and you can use it in your projects.

If you want to add a multilanguage message (i.e. error message) to your validation plugin, you need to create a custom label in Label editor and use GetCustomLabel("LABEL1") code in your javascript function, where LABEL1 is custom label title. Note that GetCustomLabel function is applicable only for editing fields like Add/Edit/Register/List with inline add/edit.

PHPR unner manual

Visual Editor - "Filter as" settings

You can customize your data appearance on the Filter Panel using formatting options on the "Filter as" settings dialog. To open this dialog right click over the field and choose Properties. For more information about adding filters to your pages, see Search and Filter settings.

visual_editor_3

Depending on selected format you will see different box-dialogs.

visual_editor_filter_as

Copy settings... option allows you to copy field settings from another field.

copy_field_settings

"Filter as" formats Values list

Boolean Interval list Interval slider

PHPR unner manual

Visual Editor - "Filter as" settings: Boolean

Displays filter as Checked/Unchecked values on default or your custom values (i.e. Yes/No, True/False). This filter works best with Checkbox fields. You can select whether to show totals.

filters_boolean

Examples of how filter is displayed in browser:

1. Show totals - "None". Default checked/unchecked messages.

filters_boolean_ex1

2. Show totals - "Count". Checked/unchecked messages - "Yes"/"No".

filters_boolean_ex2

PHPR unner manual

Visual Editor - "Filter as" settings: Interval list

Displays filter as interval list. You can create intervals list manually or using Wizard, select whether to allow multiple selection and show totals.

filters_intervals

Use 'plus'/'minus' buttons to add/delete intervals and buttons with arrows to order them. Also you can edit interval using button with pensil.

filters_intervals_add

Use Wizard to generate multiple intervals at once. For numeric fields you can define the intervals' step options and number of intervals.

filters_intervals_wizard_numbers

Wizard will generate the following intervals for text fields:

filters_intervals_wizard_text

and the following intervals for date fields : filters_intervals_wizard_data

Examples of how filter is displayed in browser:

1. Allow multiple selection - "Never", Show totals - "Count".

filters_intervals_ex1

2. Allow multiple selection - "Always", Show totals - "None".

filters_intervals_ex2

3. Allow multiple selection - "On demand", Show totals - "Max" (Horsepower field).

filters_intervals_ex3

PHPR unner manual

Visual Editor - "Filter as" settings: Interval slider

Displays filter as interval slider. You can select the appearance of slider knobs and slider step.

filters_slider

Examples of how filter is displayed in browser:

1. Slider knobs - "Both".

filters_slider_ex1

2. Slider knobs - "Min only", added "Apply" button.

filters_slider_ex2

PHPR unner manual

Visual Editor - "Filter as" settings: Values list

Displays filter as list of values. You can select whether to allow multiple selection and show totals. Sort filter options by display or database values. Set the number of first X filter options on initial load (useful when you have lots of categories).

filters_values

Select parent filter and filter data by categories and subcategories in the browser:

filters_parent

filters_values_ex4

Examples of how filter is displayed in browser:

1. Allow multiple selection - "Never", Show totals - "Count".

filters_values_ex1

2. Allow multiple selection - "Always", Show totals - "None".

filters_values_ex2

3. Allow multiple selection - "On demand", Show totals - "Max" (Horsepower field).

filters_values_ex3

PHPR unner manual

Visual Editor - "View as" settings

You can customize your data appearance on the List/View/Print/Export pages using formatting options on the "View as" settings dialog. You can define your field settings for all pages at once or separately for each page.

To control the filed appearance on the page click right button over the field and choose Properties.

visual_editor_3

To set different field formats for different pages enable the Use different settings for all pages check box. Depending on selected format you will see different box-dialogs.

visual_editor_edit_as

Copy settings... option allows you to copy field settings from another field.

copy_field_settings

Dates will be displayed in short format ( 02/17/2003 ).

Long Date

Dates will be displayed in long format ( 17 February 2003 ).

Datetime

Datetime values will be displayed as date and time ( 02/17/2003 14:22:03 ).

Time

Datetime values will be displayed as time ( 14:22:03 ).

Currency

Numeric values like 14000 will be displayed as $14 000.00 ( actual format depends on your system regional settings like currency symbol, decimal symbol etc.).

Percent

Example: 0.38 will be displayed as 38%.

Hyperlink

Choose this format if you store hyperlinks in this database field. Those hyperlinks will be made clickable automatically.

Email Hyperlink

Choose this format if you store email addresses in this database field. It will be converted into mailto HTML code automatically.

File

Choose this format if you store files in this field. For more information, see "View as" settings: File.

Image

In document PHPRunner 8.0 Manual (Page 183-193)

Related documents