Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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
  #1 (permalink)  
Old July 2nd, 2003, 03:54 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default equating javascript and ASP variables

Hi all,

This is a hybrid javascript/ASP page question.

Is it possible to pass data from a javascript variable into an ASP variable (VBScript) on the same page. What is the correct syntax?

I can only get it to work from ASP into javascript, not the other way round.

Any advice is greatly appreciated

GregH
  #2 (permalink)  
Old July 2nd, 2003, 05:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

The only way you can do it is to write the Javascript variables into a form / querystring which is being submitted to the ASP - you could use something like an IFrame or a New Window to make this almost invisible to the user.
  #3 (permalink)  
Old July 2nd, 2003, 08:23 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Hidden form fields would be a more stable way to make the form invisible to the user.
Depending on what your needs are you could use js to put all the variables you need into one hidden form field separated by commas.
Use your asp split function to separate them on the server.
More info would help choose the best way.
  #4 (permalink)  
Old July 3rd, 2003, 02:42 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks all for the feedback.

Just knowing that the task involves a submission/refresh completely alters my thoughts on the matter.

Many thanks for the advice.

Greg

GregH


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Javascript Variables to Asp.Net? Grumpy ASP.NET 2.0 Basics 4 September 8th, 2006 11:52 PM
Javascript Scope of Variables. minhtam Javascript 2 January 7th, 2006 10:27 PM
Global Variables and ClientSide Javascript haricot Classic ASP Basics 3 September 7th, 2005 10:00 AM
Using VBScript variables in Javascript PL Classic ASP Basics 4 July 29th, 2004 03:05 PM
How Do I Pass 2 Variables in Javascript Lucy Javascript 2 December 13th, 2003 11:25 AM





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