How do I pass a javascript variable in vbscript?

Im using the onchange event for a dropdown list to change SQL statements based on the index of that dropdown chosen. For example I have a function like this for my onchange event of the drop down list.

<script type=“text/javascript”>

function listboxchange(index)

declare connection …
SQL = "Select * FROM mytable WHERE Field1 = ’ “%>index<%” ’ "

make connection with SQL statement…

Im trying to pass the javascript variable “index” into the SQL statement but its not working. Am I using the wrong syntax?

I read around and it appears I cant directly do this. I have to use hidden fields? Can someone confirm this?

JavaScript doesn’t know of the existence of VBScript, and vice-versa. Never the twain shall meet, except via common intermediaries.