'id' => 'wpEmail',
'tabindex' => '6',
'size' => '20',
+ 'required' => $this->data['emailrequired'],
'placeholder' => $this->getMsg( $this->data['loggedin'] ?
'createacct-another-email-ph' : 'createacct-email-ph' )->text()
- ) + ( $this->data['emailrequired'] ? array() : array( 'required' => '' ) ) );
+ ) );
?>
<?php } ?>
</div>
</label>
<?php
$extraAttrs = array();
- // Set focus to this field if it's blank.
- if ( !$this->data['name'] ) {
- $extraAttrs['autofocus'] = '';
- }
echo Html::input( 'wpName', $this->data['name'], 'text', array(
'class' => 'loginText',
'id' => 'wpName1',
'size' => '20',
// 'required' is blacklisted for now in Html.php due to browser issues.
// Keeping here in case that changes.
- 'required',
+ 'required' => true,
+ // Set focus to this field if it's blank.
+ 'autofocus' => !$this->data['name'],
'placeholder' => $this->getMsg( 'userlogin-yourname-ph' )->text()
- ) + $extraAttrs );
+ ) );
?>
</div>
?>
</label>
<?php
- $extraAttrs = array();
- // Set focus to this field if username is filled in.
- if ( $this->data['name'] ) {
- $extraAttrs['autofocus'] = '';
- }
echo Html::input( 'wpPassword', null, 'password', array(
'class' => 'loginPassword',
'id' => 'wpPassword1',
'tabindex' => '2',
'size' => '20',
+ // Set focus to this field if username is filled in.
+ 'autofocus' => (bool)$this->data['name'],
'placeholder' => $this->getMsg( 'userlogin-yourpassword-ph' )->text()
- ) + $extraAttrs );
+ ) );
?>
</div>