DarkConsultant
Programmer
Hi,
I have inherited a project which involves some javascript. I am a bit of a newbe and need to ask a question. Sorry if this is a daft question.
I have a function called StringRandom that generates a random password string. Is there any way to pass a parameter that refers to a field with the same form.
So if I have eight fields in my form called passfield1 - 8 can I call StringRandom("passfield1") for example and get the random string placed into passfield1. I have achieved this by passing 1 thru 8 as a parameter and using a long if .. elseif (sounds of retching) block but I dont really like this.
Sorry if this is a bit basic but I have tried for about an hour seaching but do not think I know the correct words to search for. The last time I touched javascript was about 10 years ago.
TIA
David Wadsworth
DarkConsultant
Live long and prosper \\//
I have inherited a project which involves some javascript. I am a bit of a newbe and need to ask a question. Sorry if this is a daft question.
I have a function called StringRandom that generates a random password string. Is there any way to pass a parameter that refers to a field with the same form.
So if I have eight fields in my form called passfield1 - 8 can I call StringRandom("passfield1") for example and get the random string placed into passfield1. I have achieved this by passing 1 thru 8 as a parameter and using a long if .. elseif (sounds of retching) block but I dont really like this.
Sorry if this is a bit basic but I have tried for about an hour seaching but do not think I know the correct words to search for. The last time I touched javascript was about 10 years ago.
TIA
David Wadsworth
DarkConsultant
Live long and prosper \\//