473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Passing variables from Javascript to ASP

Hello,
I am having problems with passing variables between pages. I have the
following:
First asp page has the function:
-----------------------------------------------------------------------
<script language="JavaScript">
function addProcess(addPName,addSProcess,addPIndex)
{
var addProcessWindow =
window.open('second.asp','mywindow','width=400,hei ght=200');
addProcessWindow.focus();
return(true);
}
</script>
--------------------------------------------------------------------------------------------
There is button (not in a form) that is clicked and calls the function above.
The variables addPName,addSProcess, and addPIndex are the variables I need
to pass and be able to reference on to the page 'second.asp'.
For now, all I am trying to do is to verify if the values are being passed
to my 'second.asp' page. How can I retrieve the values in the page
below?--------------------------------------------------------------------------------------------
<%@ LANGUAGE="JScript" %>
<html>
<head>
<title>Second</title>
<%
Response.Write ???? -> variables here...
%>
</head>
<body>
</body>
</html>
----------------------------------------------------------------------------------------------
Please help!
Thanks. :-)

Jul 19 '05 #1
1 3582
Pass them in the querystring. Example:

yourpage.asp:
<html>
<head>
<script language="JavaScript">
function addProcess(addPName,addSProcess,addPIndex)
{

var addProcessWindow = window.open('second.asp?a='+addPName + '&b=' +
addSProcess + '&c=' + addPIndex,'mywindow','width=400,height=200');
addProcessWindow.focus();
return(true);
}
</script>
</head>
<body>
<button onclick="addProcess('Hi ','there ','Consuelo');">Click me</button>
</body>
</html>
second.asp:
<%
Response.Write Request.Querystring("a") & Request.Querystring("b") &
Request.Querystring("c")
%>
Note that you don't have to use "a," "b," and "c." You can do
'second.asp?whateveryoulike=' + addPName....

Ray at home


"Consuelo Guenther" <Co**************@discussions.microsoft.com> wrote in
message news:CA**********************************@microsof t.com...
Hello,
I am having problems with passing variables between pages. I have the
following:
First asp page has the function:
-----------------------------------------------------------------------
<script language="JavaScript">
function addProcess(addPName,addSProcess,addPIndex)
{
var addProcessWindow =
window.open('second.asp','mywindow','width=400,hei ght=200');
addProcessWindow.focus();
return(true);
}
</script>
--------------------------------------------------------------------------------------------
There is button (not in a form) that is clicked and calls the function
above.
The variables addPName,addSProcess, and addPIndex are the variables I need
to pass and be able to reference on to the page 'second.asp'.
For now, all I am trying to do is to verify if the values are being passed
to my 'second.asp' page. How can I retrieve the values in the page
below?--------------------------------------------------------------------------------------------
<%@ LANGUAGE="JScript" %>
<html>
<head>
<title>Second</title>
<%
Response.Write ???? -> variables here...
%>
</head>
<body>
</body>
</html>
----------------------------------------------------------------------------------------------
Please help!
Thanks. :-)

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
2
by: brianwmunz | last post by:
Hi, I'm having a problem passing a variable through a URL because the variable is supposed to hold a URL that has a variable of its own. Here is an idea of what I'm trying to do: href="javascript:...
6
by: Eric Johnston | last post by:
I want the visitor to enter three numbers on the page and then click a button "generate image" which will I hope cause a generated gif image to be displayed alongside on the page. This involved...
9
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
3
by: jsdeveloper | last post by:
Hi, I just started programming in javascript, and I'm having a problem passing variables between javascript and asp code in .asp page. Can you please help? I've given the sample code below. ...
1
by: johnjsforum | last post by:
Buddies, I have a web page to create HTML buttons dynamically as in the “formDivColorPicker” function ////////////////////////////////////////////////////////////////////////////////////...
3
by: q-rious | last post by:
Hello All, 1. I would like to pass some variables (x and y below) from Javascript to PHP, process them in PHP, and return some other variables (a abd b) back to Javascript. --(x,y)--...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.