* of the value from 'default'. Overrides 'buttonlabel-raw'.
* - buttonlabel-raw: HTMLto display for the button display text, instead
* of the value from 'default'.
+ * - formnovalidate: Set to true if clicking this button should suppress
+ * client-side form validation. Used in HTMLFormFieldCloner for add/remove
+ * buttons.
*
* Note that the buttonlabel parameters are not supported on IE6 and IE7 due to
* bugs in those browsers. If detected, they will be served buttons using the
/** @var array $mFlags Flags to add to OOUI Button widget */
protected $mFlags = [];
+ protected $mFormnovalidate = false;
+
public function __construct( $info ) {
$info['nodata'] = true;
if ( isset( $info['flags'] ) ) {
$this->mFlags = $info['flags'];
}
+ if ( isset( $info['formnovalidate'] ) ) {
+ $this->mFormnovalidate = $info['formnovalidate'];
+ }
+
# Generate the label from a message, if possible
if ( isset( $info['buttonlabel-message'] ) ) {
$this->buttonLabel = $this->getMessage( $info['buttonlabel-message'] )->parse();
'type' => $this->buttonType,
'name' => $this->mName,
'value' => $this->getDefault(),
+ 'formnovalidate' => $this->mFormnovalidate,
] + $this->getAttributes( [ 'disabled', 'tabindex' ] );
if ( $this->isBadIE() ) {
if ( isset( $this->mParams['fields']['delete'] ) ) {
$class = 'mw-htmlform-cloner-delete-button';
$info = $this->mParams['fields']['delete'] + [
+ 'formnovalidate' => true,
'cssclass' => $class
];
unset( $info['name'], $info['class'] );
: 'htmlform-cloner-delete';
$field = HTMLForm::loadInputFromParameters( $name, [
'type' => 'submit',
+ 'formnovalidate' => true,
'name' => $name,
'id' => Sanitizer::escapeId( "{$this->mID}--$key--delete" ),
'cssclass' => 'mw-htmlform-cloner-delete-button',
: 'htmlform-cloner-create';
$field = HTMLForm::loadInputFromParameters( $name, [
'type' => 'submit',
+ 'formnovalidate' => true,
'name' => $name,
'id' => Sanitizer::escapeId( "{$this->mID}--create" ),
'cssclass' => 'mw-htmlform-cloner-create-button',