You are here

function hostingService_example_basic::validate in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 example/example_service/hosting_example.service.inc \hostingService_example_basic::validate()
  2. 7.3 example/example_service/hosting_example.service.inc \hostingService_example_basic::validate()

Validate a form submission.

Overrides hostingService::validate

File

example/hosting_example.service.inc, line 137
Example service implementation for the hosting front end.

Class

hostingService_example_basic
An implementation of the example service type, registered with hook_hosting_service.

Code

function validate(&$node, &$form) {

  // REMEMBER TO CALL THE PARENT!
  parent::validate($node, $form);
  if (sizeof($this->example_field) > 30) {
    form_set_error('example_field', t("The example string must not be longer than 30 characters"));
  }
}