Solved

accessing jscript variables

Posted on 2000-05-06
6
475 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
Technology Partners: 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!

 
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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Time comparison asp 1 20
MS SQL and column defined as time 7 25
Validating Date Part2 2 27
add 'N to prepared ASP/VB insert statement 1 10
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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