Access, Javascript,and SQL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a data access page in Access that has a few dropdown lists, buttons
and textboxes on it. (pretty simple) When you view the access page and enter
information into the fields, it stores the data in an SQL db. In the code of
my data access page, I have a javascript password generator:
<SCRIPT language=JavaScript>
<!-- Begin
function randomPassword()
{
chars = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789";
pass = "";
for(x=0;x<10;x++)
{
i = Math.floor(Math.random() * 62);
pass += chars.charAt(i);
}
return pass;
}
function formSubmit()
{
password.value = randomPassword();
return false;
}
// End -->
</SCRIPT>

On my data access page is a text box called password. I want the password
text box to fill when the page loads with information generated by my
function called randomPassword()
so i used the following code in the <body> tag

<body onload=formSubmit()>

this should work but it does not put my generated password in my text box
called password. Any ideas?
 
MORE INFO !
The script i wrote about earlier that generates the password and the onload
statement run and fill the password box (which is what I want) but once I
connect to my data source (my sql database called LegalDocs) it looks like
the script runs, the password box gets filled, but then the screen flashes
and the box is empty again. not sure if the screen flash is when it actually
reads the db and tries to present the db info or if it a screen refresh.
 
Back
Top