Solved

accessing jscript variables

Posted on 2000-05-06
6
477 Views
Last Modified: 2006-11-17
Hi

I have written an asp page in Jscript with a database that all works fine.

However I have some buttons that call javascript functions, which basically builds a list of the links that have been clicked on that page, with the data stored in a string.

How can I access that variable from with in the asp code, so that I can display that variable on the page.
It gives me this error, where test is a string variable :

Error Type:
Microsoft JScript runtime (0x800A1391)
'test' is undefined
/asp/database/validate.asp, line 85


in response to asp code :

%>testing :<% test %><%


Thanks

Phil
0
Comment
Question by:philmeier
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 1

Expert Comment

by:pauljk
ID: 2784591
The javascript you are using is client side and doesn't come back to the server side asp processing.  What I would do is set up a hidden input box where I would store the value of the javascript.  This value can then be picked up by the ASP request object.
0
 

Author Comment

by:philmeier
ID: 2784606
ok thanks that makes sense, how do I set up a hidden input box and place this string value in it.

Phil
0
 
LVL 1

Expert Comment

by:pauljk
ID: 2784619
In HTML...  

<form ID="frmInput" Name="frmInput">
<INPUT TYPE="HIDDEN" NAME=Hbox ID=Hbox value="NOTHING">
</form>

In JavaScript...

document.forms['frmInput'].Hbox.value='The value you want in the box';

In JScript...

Request("Hbox")


0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 1

Accepted Solution

by:
pauljk earned 25 total points
ID: 2784633
In HTML...  

<form ID="frmInput" Name="frmInput">
<INPUT TYPE="HIDDEN" NAME=Hbox ID=Hbox value="NOTHING">
</form>

In JavaScript...

document.forms['frmInput'].Hbox.value='The value you want in the box';

In JScript...

Request("Hbox")


0
 

Author Comment

by:philmeier
ID: 2784774
Thanks will try it

Phil
0
 

Author Comment

by:philmeier
ID: 2786149
works fine
thanks
Phil
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question