Solved

accessing jscript variables

Posted on 2000-05-06
6
471 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now