I'm new to ASP and need some help.

I've got an asp page that does some validation and then
I pass a variable to a Client Side Java Script function.

The JS function does not recognize the ASP variable.
I tried using "document.all['<%=ASPVariableName%>'].value"
with no success.

The only way I found to pass anything to the JS function
is to create a hidden field on the form and reference it
like "form.HiddenFieldName.value"

Any suggestions would be greatly appreciated.