Manual talk:HTMLForm Tutorial 3

htmlform-select-badoption errors
If you're building a select dropdown and you're getting htmlform-select-badoption errors, try adding a default value. This array was throwing errors:

Copying the array from the tutorial did not throw errors:

Note that their structures are the same; one is just a bit more complex than the other.

Making an explicit default got rid of the error message:

Rstockbower (talk) 19:01, 27 September 2012 (UTC)

HTMLApiField usage ?
public static $typeMappings = [ 'api' => 'HTMLApiField',

Can this be used for custom html api ?

This code is found in the mediawiki/includes/api/htmlform/HTMLform.php