[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 480
  • Last Modified:

accessing jscript variables

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
philmeier
Asked:
philmeier
  • 3
  • 3
1 Solution
 
pauljkCommented:
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
 
philmeierAuthor Commented:
ok thanks that makes sense, how do I set up a hidden input box and place this string value in it.

Phil
0
 
pauljkCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
pauljkCommented:
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
 
philmeierAuthor Commented:
Thanks will try it

Phil
0
 
philmeierAuthor Commented:
works fine
thanks
Phil
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now