user.module - Problemi di accessibilità
Il rispetto delle regole dell'accessibilità vuole che nelle caselle sia inserita la precisazione "qui nome" - "qui password" in modo che un non vedente sappia esattamente dove introdurre nome e password.
Ho corretto il modulo user (drupal 4.7.3) così:
originale
$form['#action'] = url($_GET['q'], drupal_get_destination());
$form['#id'] = 'user-login-form';
$form['name'] = array('#type' => 'textfield',
'#title' => t('Username'),
'#maxlength' => 60,
'#size' => 15,
'#required' => TRUE,
);
$form['pass'] = array('#type' => 'password',
'#title' => t('Password'),
'#size' => 15,
'#required' => TRUE,
);
$form['submit'] = array('#type' => 'submit',
'#value' => t('Log in'),
);corretto
if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
$form['#action'] = url($_GET['q'], drupal_get_destination());
$form['#id'] = 'user-login-form';
$form['name'] = array('#type' => 'textfield',
'#title' => t('Username'),
'#maxlength' => 60,
'#size' => 20,
'#default_value' => t('Inserisci nome'),
'#required' => TRUE,
);
$form['pass'] = array('#type' => 'textfield',
'#title' => t('Password'),
'#size' => 20,
'#default_value' => t('Inserisci password'),
'#required' => TRUE,
);
$form['submit'] = array('#type' => 'submit',
'#value' => t('Log in'),
);Funziona, ma quando inserisco la password, questa resta evidente sul video. Potete aiutarmi? Grazie

Risposte
Devi mettere il campo
Devi mettere il campo password di tipo "password" e non "textfield".
Ho provato, ma...
Premetto che di PHP ne so pochissimo, ma ho tentato e ho corretto così:
$form['pass'] = array('#type' => 'password','#title' => t('Password'),
'#size' => 20,
'#default_value' => t('Inserisci password'),
'#required' => TRUE,
Funziona, ma nella casella non compare più "Inserici password" o gli asterischi che nascondono la password.
Mi puoi aiutare?
Grazie
ciao, qua entra in gioco il
ciao, qua entra in gioco il form fai da te.
tu desideri un form che sia di tipo 'text' e di tipo 'password'.
eccoti lo snippet per il campo di testo "come lo vuoi tu": ;)
<input type=text name=mytext value="Inserisci password.."onkeypress="
if (this.type != 'password')
{
this.type='password';
this.value='';
}
">