Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
MoodleQuickForm_Rule_Required Class Reference
Inheritance diagram for MoodleQuickForm_Rule_Required:

Public Member Functions

 getValidationScript ($format=null)
 This function returns Javascript code used to build client-side validation. More...
 
 validate ($value, $options=null)
 Checks if an element is not empty. More...
 

Member Function Documentation

◆ getValidationScript()

MoodleQuickForm_Rule_Required::getValidationScript (   $format = null)

This function returns Javascript code used to build client-side validation.

It checks if an element is not empty.

Parameters
int$formatformat of data which needs to be validated.
Return values
array

◆ validate()

MoodleQuickForm_Rule_Required::validate (   $value,
  $options = null 
)

Checks if an element is not empty.

This is a server-side validation, it works for both text fields and editor fields

Parameters
string$valueValue to check
int | string | array$optionsNot used yet
Return values
booltrue if value is not empty

The documentation for this class was generated from the following file: