PDA

View Full Version : ASP to javascript


siobi
02-08-2004, 09:47 PM
Dear all!!!!
help

I had to pass a variable from ASP to javascript....

and also using ASP to call a javascript function...

can it be done?
please assist...

[email protected]
[email protected]

URgent

Crismo
02-12-2004, 08:46 AM
It might not be the most elegant way, but it works.

Add a form with a hidden input element.
From asp to Javascript you would just place the value inside the element with asp code, and then get the value into Javascript by way of form.elements.

The other way form Javascript to asp.
Use the form.elements. in javascript to add the value that you want.
Then use form.submit to send it back to the same page.
Now you can use the request object of asp to pick up the value