Click to See Complete Forum and Search --> : Please Help, passing a javascript variable to asp variable and page.


sjcosh
11-20-2005, 07:17 PM
Hi,

Im new to asp and programming, i have a javascript variable on one page that i need to pass over to an asp page so i can write the value out to my database.

the var is totScore

any help would be fantastic.

buntine
11-20-2005, 11:40 PM
Pass the variable via the QueryString.

Javascript:

window.location = 'yourpage.asp?totScore=' + totScore;

ASP:

Dim strTotScore
strTotScore = Request.QueryString("totScore")

Make sense?

Regards.

sjcosh
11-21-2005, 05:02 PM
Thanks Andrew yes it makes sense, and when i think about it rather easily acheived.

Bullschmidt
11-24-2005, 01:58 AM
Or you can use JavaScript to set a hidden field's value and that would automatically carry over with a post...