Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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