fill a password element using js

Status
Not open for further replies.

lcollong

FabriKant d'applications web
Hi,

Using the juser plugin, I want to prefilled with some values most of the sync fields of this plugin. Specially while creating a new user. I'm using js to "read" the values from the firstname/name fields of the main table and fill in the name/username sync fields with some adequate values. Works well. However, I want to generate a random password the same way. I'm able to fill in the first part of the password element but I can't reach the "password_check" second field. Is this possible ?

this is working on the first part of the password element :
form.formElements.get('fk_membres___j_password').update(randomstring);

but this is not working :
form.formElements.get('fk_membres___j_password_check').update(randomstring);

is there a special method ?

If I use a regular field to sync password on, the juser plugin sync on edit functionality wipes off the password !.....
 
I think the way to go is to have two forms: one for registration and one for editing.
  1. On the registration form, you use a hidden calc element to generate the random password
  2. On the editing form, you use a password element so the user can change the password
 
Good point. Thanks. I would have think of a much "simple" way. But it should do it.
 
Rob, Hugh ? Default value on the Password Element (eval) ? Would it be possible (both fields filled) ?
 
Gentle bump for a possible JS solution before setting up the double form as JF suggested.
 
you can not edit access values inside password fields using javascript. The browsers block this as a security measure. So I guess JFQ's suggestion is the way to go
 
Ok. I'll do that. Maybe sometime in the future we could have the password field with a default value (eval) allowing automatic generation of random password at user creation ?
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top