views:

25

answers:

1

I want to pre-fill the password field from the Cookie. I am setting the '#value' but its not rendered . Also tried #default_value . Is there any way to do this ?

A: 

The password textfield doesn't use #default_value, as reported in Form API reference. You should implement your own form field, to pre-fill the password textfield. I am not sure if browsers would permit a password textfield to be pre-filled, though.

kiamlaluno
Most of them do. I actually haven't seen one that doesn't.
quantumSoup
thanks for the reply. Earlier i had tried with the html input(without using the form api) which worked . Now i am using the drupal's user_login form and in the pre-process method trying to set the password. For user name field its working. What could be the alternative ?
Jinesh
Apart what I suggested, I cannot see other alternatives; there is no way to alter the output returned from each implementation of hook_elements() (Drupal core code does not use hook_elements_alter(), or you would be able to change the implementation of the password form field done by system.module.
kiamlaluno