[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Passing multiple variables in a javascript popup to another popup

Posted on 2003-12-09
5
Medium Priority
?
1,509 Views
Last Modified: 2010-04-06
I'm not sure if I'm providing enough information here:

Basically, I have a popup window that is generated by some javascript (I found the javascript on a "get a free script" site and it worked rather well for me). Rather, it worked very well when I only passed one variable from this popup window to another popup window. Now, I need to come back to this several months later and pass two variables from this page to the next. Here's what I have:

<script language="JavaScript" src="/resources/popup.js"></script>

<form name="Custom" method="post" action="javascript:CreateWnd('srvpatch.asp?Server5=<%=strServer%>', 500, 700, true);"
<input name="Server5" type="hidden" value="<%=strServer%>">
<input type="submit" value="View">&nbsp; <strong><font color="#008080">Missing Patch Status</font></strong><BR>
</FORM>

I tried a few different things:

<form name="Custom" method="post" action="javascript:CreateWnd('srvpatch.asp?Server5=<%=strServer%>', 500, 700, true);"
<input name="Server1" type="hidden" value="<%=strServer%>">
<input name="Server2" type="hidden" value="<%=strServer%>">
<input type="submit" value="View">&nbsp; <strong><font color="#008080">Missing Patch Status</font></strong><BR>
</FORM>

However, it would seem that the variable being passed is being passed from here instead:

action="javascript:CreateWnd('srvpatch.asp?Server5=<%=strServer%>', 500, 700, true);"

How can I alter this line to pass more than one variable? Is there a better way to do this? Speaking down to me is encouraged as I'm not very good at this :)

Thanks,
Tim

0
Comment
Question by:timmr72
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:kmalhotra
ID: 9907216
Do you wish to pass another variable by query string?

action="javascript:CreateWnd('srvpatch.asp?Server5=<%=strServer%>&Server2=<%=strServer2%>', 500, 700, true);"
If I misunderstood your question, please elaborate.

Thanks
KM


0
 

Author Comment

by:timmr72
ID: 9907433
I'm getting a type mismatch when I try your example. You are correct though, that's exactly what I'm trying to do.
Thanks
0
 
LVL 2

Expert Comment

by:kmalhotra
ID: 9907680
There is obviously a problem in creating the string. LEts try this :)

var lstrURL
lstrURL  = "srvpatch.asp?Server5=<%=strServer%>&Server2=<%=strServer2%>"
alert  (lstrURL);
CreateWnd(lstrURL, 500, 700, true);"
or we can also use
window.open(lstrURL, 500, 700, true);

Please try and let me know

Thanks
KM
0
 
LVL 2

Accepted Solution

by:
kmalhotra earned 800 total points
ID: 9907779
I tried this function and it seems to work well

function test()
      {
            var url;
            url = 'srvpatch.asp?Server5=<%="hello"%>&Server2=<%="world"%>'
            alert(url);
            window.open(url, 500, 700, true);

      }

Thanks
KM
0
 

Author Comment

by:timmr72
ID: 9908419
Yup. That seemed to do the trick for me :)

I bumped up the points to 200. Thank you very much for the quick assistance.

Thanks again,
-Tim
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question