I've been asked to alter an ASP form that someone else designed. I don't normally code ASP forms, and my knowledge of session variables and javascript is extremely limited so I am a little lost.
There is a seperate login form which creates a session.contents("UserID").
The form I am working on adds records to the database, and uses the session.contents("UserID") as one of the fields.
In order to change the user without logging out and then logging back in, I have created a drop-down and populated it with a recordset of users from the database. I'm trying to change the session.contents("UserID") from the OnChange event of this drop-down.
I've created the following javascript function to change the session.contents("UserID"), but it poops out and I don't know why:
The Alert comes up and shows the correct new user, but the Session.contents("UserID") does not change.
Can anyone help me figure out why?
or
Is there a better way to accomplish this?
Thanks,
Sup
There is a seperate login form which creates a session.contents("UserID").
The form I am working on adds records to the database, and uses the session.contents("UserID") as one of the fields.
In order to change the user without logging out and then logging back in, I have created a drop-down and populated it with a recordset of users from the database. I'm trying to change the session.contents("UserID") from the OnChange event of this drop-down.
I've created the following javascript function to change the session.contents("UserID"), but it poops out and I don't know why:
Code:
function UserChange(fm){
Alert("User will be changed to " + document.formAddRecord.UserList.value)
Session.Contents("UserID") = document.formAddRecord.UserList.value
}
The Alert comes up and shows the correct new user, but the Session.contents("UserID") does not change.
Can anyone help me figure out why?
or
Is there a better way to accomplish this?
Thanks,
Sup