Hi
I am trying to change default label. I thought:

$form['general_expectations'] = array(
'#type' => 'textarea',
'#title' => t('If you were to be successful in this application, what are your expectations?'),
'#default_value' => isset($ohr_applicant->general_expectations) ? $ohr_applicant->general_expectations : '',
'#rows' => 2,
'#maxlength' => 600,
'#maxlength_js' => TRUE,
'#maxlength_js_label' => 'asasdf',

'#attributes' =>array(
'#maxlength_js_label' => '!limit characters remained',

),
'#required' => TRUE,
);

But it still shows the default maxlength_js_label. Help is appreciated

Comments

zulfierken’s picture

I just found the answer. Just a stupid mistake lol.

Here is the code if you are looking for solution:

$form['general_expectations'] = array(
'#type' => 'textarea',
'#title' => t('If you were to be successful in this application, what are your expectations?'),
'#default_value' => isset($ohr_applicant->general_expectations) ? $ohr_applicant->general_expectations : '',
'#rows' => 2,
'#maxlength' => 600,
'#maxlength_js' => TRUE,
'#attributes' =>array(
'maxlength_js_label' => '@remaining characters left.',

),
'#required' => TRUE,
);

slv_’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)