473,219 Members | 1,737 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,219 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 3578
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 online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.