8 $p = parent::validate(
$value, $alldata );
16 if ( in_array( strval(
$value ), $validOptions,
true ) ) {
19 return $this->
msg(
'htmlform-select-badoption' );
26 if ( !empty( $this->mParams[
'disabled'] ) ) {
27 $select->setAttribute(
'disabled',
'disabled' );
30 $allowedParams = [
'tabindex',
'size' ];
32 foreach ( $customParams as $name =>
$value ) {
33 $select->setAttribute( $name,
$value );
36 if ( $this->mClass !==
'' ) {
37 $select->setAttribute(
'class', $this->mClass );
42 return $select->getHTML();
47 $allowedParams = [
'tabindex' ];
48 $attribs = OOUI\Element::configFromHtmlAttributes(
52 if ( $this->mClass !==
'' ) {
56 if ( !empty( $this->mParams[
'disabled'] ) ) {
60 return new OOUI\DropdownInputWidget( [
61 'name' => $this->mName,
64 'value' => strval(
$value ),
65 'disabled' => $disabled,
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.
shouldInfuseOOUI()
Whether the field should be automatically infused.
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
Class for generating HTML <select> or <datalist> elements.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs