CC-3093: SoundCloud preferences do not have email or password as required fields + firefox auto-fills the password field

- Make the form fields required
- Append "Required" label to the fields
- Disable autocomplete for the fields
This commit is contained in:
Yuchen Wang 2011-11-23 12:52:35 -05:00
parent 161fa80d64
commit d3df4b14d2
2 changed files with 12 additions and 6 deletions

View File

@ -42,9 +42,10 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
//SoundCloud Username
$this->addElement('text', 'SoundCloudUser', array(
'class' => 'input_text',
'label' => 'SoundCloud Email:',
'required' => false,
'label' => 'SoundCloud Email',
'required' => true,
'filters' => array('StringTrim'),
'autocomplete' => 'off',
'value' => Application_Model_Preference::GetSoundCloudUser(),
'decorators' => array(
'ViewHelper'
@ -54,9 +55,10 @@ class Application_Form_SoundcloudPreferences extends Zend_Form_SubForm
//SoundCloud Password
$this->addElement('password', 'SoundCloudPassword', array(
'class' => 'input_text',
'label' => 'SoundCloud Password:',
'required' => false,
'label' => 'SoundCloud Password',
'required' => true,
'filters' => array('StringTrim'),
'autocomplete' => 'off',
'value' => Application_Model_Preference::GetSoundCloudPassword(),
'decorators' => array(
'ViewHelper'

View File

@ -40,7 +40,9 @@
<?php endif; ?>
</dd>
<dt id="SoundCloudUser-label" class="block-display">
<label class="optional" for="SoundCloudUser"><?php echo $this->element->getElement('SoundCloudUser')->getLabel() ?></label>
<label class="optional" for="SoundCloudUser"><?php echo $this->element->getElement('SoundCloudUser')->getLabel() ?>
<span class="info-text-small">(Required)</span> :
</label>
</dt>
<dd id="SoundCloudUser-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudUser') ?>
@ -53,7 +55,9 @@
<?php endif; ?>
</dd>
<dt id="SoundCloudPassword-label" class="block-display">
<label class="optional" for="SoundCloudPassword"><?php echo $this->element->getElement('SoundCloudPassword')->getLabel() ?></label>
<label class="optional" for="SoundCloudPassword"><?php echo $this->element->getElement('SoundCloudPassword')->getLabel() ?>
<span class="info-text-small">(Required)</span> :
</label>
</dt>
<dd id="SoundCloudPassword-element" class="block-display">
<?php echo $this->element->getElement('SoundCloudPassword') ?>