passing asp recordset varriable to vbscipt
bhushan98 | Posted 10:38pm 27. March 2009 Server Time |
Hello Sir,
I am a newbie to asp development. I am having a problem for how to pass a asp recordset value to vbscript function.
the code I tried is mentioned below :
**** Below function is having a varriable grs which is to be transferred to other vbscript function on the lost focus of an another textbox.
<%
function status()
set rs = server.CreateObject("adodb.recordset")
sql = "select sum(bill_amt)as grs, sum(tds) as gtds from firmdt where code="& session("code") &" and fy ='"& trim(session("fy")) & "';"
rs.Open SQL, objconn
response.write("Gross = " & rs("grs") & " T.D.S. = " & rs("gtds"))
grs=rs("grs")
end function
%>
*** text box calling vbscript function
<input type="text" name=txtgross id=txtgross size="20" onBlur="vbscript:clctax()"> </td> <tr>
****** Called vbscript function
<script language = "vbscript">
Function clctax()
dim bill
msgbox(form1.txtgross.value)
bill=cdbl(form1.txtgross.value)
msgbox("<% =grs %>")
if (gros + bill) > 20000 then
tax = (grs+bill) * (cdbl(form1.txttax.value)/100)
msgbox(tax)
end if
End Function
</script>
....
But the code is not working, kindly guide me to solve the problem
Thanks in advance.
|