I had the problem of using the variable in asp code that had passed in java script function
Here the code i used
Code:
function fun(form2,cname) { alert(cnme.value) <% set sql=server.CreateObject("ADODB.RECORDSET") set sql=ADOCONN.EXECUTE("SELECT DISTINCT app_no FROM app_request WHERE((username) LIKE '"&cname&"') ORDER BY app_no")