I have a custom module built, and I would like to grey out and disable the submit form button if the textfield is empty. Can anyone help?
Here is the code for the textfield and the form button:
$form['ro-user-details']['nickname'] = array(
'#type' => 'textfield', '#width' => 50,
'#title' => t('Nickname'),
'#default_value' => $ro_user->nickname,
'#size' => 50,
'#maxlength' => 200,
'#required' => TRUE,
);
$form['ro-user-details']['change_nickname'] = array('#type' => 'submit', '#value' => t('Change Nickname'));