Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 10th, 2003, 09:10 AM
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default rescord set into javascript function

Is it posible to pass a record set created from an sql statment using the "strsubjectrec = rstsubject.GetRows" format in to a a javascript fuction via an "OnChange" form event in asp.
What i am trying to achieve is to change a fixed field value on a form to a matching value, when a user changes another field from a drop down list, both sets of values are obtained from asql database, and as the form contains a considerable number of fields I do not want to recreate the form very time a value is changed.

Thanks in advance

Dave WX
 
Old December 10th, 2003, 10:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not 100% sure what you're trying to accomplish.

If your question is whether you can pass the values from the recordset back to a JavaScript function, the answer is: yes you can.

Consider this:

<%
  Dim MyASPVariable
  MyASPVariable = "Hello"
%>


<script language="JavaScript" type="text/javascript">
  var MyJavaScriptVariable = '<%=MyASPVariable%>'
</script>

This way, the value of the server variable MyASPVariable will end up as a client side JavaScript variable called MyJavaScriptVariable.

If you combine this with some smart GetRows usage, you can return ready to use JavaScript arrays you can use in your client side code.

Kind regards,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
node-set function Bernardo Pacheco XSLT 2 June 19th, 2006 10:45 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
Javascript SET Method? TSEROOGY Javascript How-To 2 February 7th, 2004 09:20 PM
How to "Set" a function equal to a DataReader DittoToo ASP.NET 1.0 and 1.1 Basics 1 July 1st, 2003 10:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.