15 $p = parent::validate( $value, $alldata );
23 if ( in_array( strval( $value ), $validOptions,
true ) ) {
26 return $this->
msg(
'htmlform-select-badoption' );
35 $select =
new XmlSelect( $this->mName, $this->mID, strval( $value ) );
37 if ( !empty( $this->mParams[
'disabled'] ) ) {
38 $select->setAttribute(
'disabled',
'disabled' );
41 $allowedParams = [
'tabindex',
'size' ];
43 foreach ( $customParams as $name => $value ) {
44 $select->setAttribute( $name, $value );
47 if ( $this->mClass !==
'' ) {
48 $select->setAttribute(
'class', $this->mClass );
53 return $select->getHTML();
62 $allowedParams = [
'tabindex' ];
63 $attribs = OOUI\Element::configFromHtmlAttributes(
67 if ( $this->mClass !==
'' ) {
71 if ( !empty( $this->mParams[
'disabled'] ) ) {
75 return new OOUI\DropdownInputWidget( [
76 'name' => $this->mName,
79 'value' => strval( $value ),
80 'disabled' => $disabled,
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.Don't forget to call pare...
getInputOOUI( $value)
Same as getInputHTML, but returns an OOUI object.Defaults to false, which getOOUI will interpret as "...
shouldInfuseOOUI()
Whether the field should be automatically infused.Note that all OOUI HTMLForm fields are infusable (y...
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.