Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying data in a popup window.

Status
Not open for further replies.

MarkWilliamson

Programmer
Apr 1, 2002
34
US
Just to warn everyone I am a NOVICE at HTML.

My problem is that I have a calendar on a page and ask the user to select a date. I then want to display all sales for the date selected by the user in a popup window. I have a JAVASCRIPT routine which handles the popup I am just trying to reference the date selected by the user so I can retrieve the records. As of now I have had ABSOLUTLEY NO LUCK !

If anyone could help me out I'd appreciate it !

My input tag is below..

<input type="BUTTON" Value="Select Name" Name=SelectDate OnClick="popup('c:\file.asp','pagename','640','480','center','front');">

 
I've taken the onclick part of your button and added some code to it (bold) that will pass the value of the date field into the popup as part of the URL.
Code:
OnClick="popup('c:\file.asp[b]?date='+escape(document.getElementById('Date').value)[/b],'pagename','640','480','center','front');
All you need to do now is ensure you put an id="Date" into the input field for the date (assuming it doesn't already have an ID). If it does already have an ID, then change my code above to use the same ID (rather than Date).

Hope that makes some sense.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Thank you Jeff ! Now I am having a problem with my script in my popup window not functioning.. For now all I am trying to do is to display the query string from the parent form.

Again thanks in advance to anyone who offers help !



<%@ Language="VBScript" %>

<html>
<head>

</head>


<body bgcolor=FFFF00 link = 3300FF vlink = AA0000>

<%
Response.Write ("str " + Request.QueryString)
%>

</body>
</html>
 
My asp is a little rusty... but I think you're looking for something like this:
Code:
<%@ Language="Javascript" %>
<html>
<head>
<script type="text/javascript">
var passedDate = '<%  Response.Write ("" + Request.QueryString("date"));  %>';
</script>
</head>
<body bgcolor=FFFF00 link = 3300FF vlink = AA0000>
<%  Response.Write ("" + Request.QueryString("date"));  %>
</body>
</html>
I added the variable declaration as well, since you may want an easy way to get access to it in the popup :)

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top