?
Solved

Passing values of in an form

Posted on 2004-04-01
6
Medium Priority
?
487 Views
Last Modified: 2012-05-04
Hello everyone, I know your busy and this is probably not hard but I am not sure why it isn't working. IF i have a dropdown box or input box an asp form and when I click on the submit I am opening another window up with another asp form to fill out more information. I need to pass that dropdown and input box information from my first form to my second form. How do I do that. I am not sure.
0
Comment
Question by:D_basham
6 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10737136
If your dropdown is ddown, and your parent form has a hidden form element...
you can say

parent.forms[0].formvar.value=document.forms[0].ddown.value;
0
 

Expert Comment

by:dlzone
ID: 10737869
= Main.asp =

<html>
<body>
  <form action = "dothings.asp" method = "post">
    <select name = "stuff">
      <option value = "A" >A</option>
      <option value = "B" >B</option>
    </select>
    <input type = "text" name = "stuff2">
  </form>
</body>
</html>


=dothings.asp=

<%

strStuff = Request.Form("stuff")
strStuff2 = Request.Form("stuff2")

%>
0
 
LVL 4

Expert Comment

by:anderson22
ID: 10738379
Is the second window a popup?  If not, you can just change the target of the form to "_blank" and this will send the form data to the second window.  At that point, you can use the ASP Request object to access the data.

-rca
0
Technology Partners: 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!

 

Author Comment

by:D_basham
ID: 10740623
Thanks for the help. It still not giving me the info. Maybe it is my submit button code. This is what I have

onClick="window.open('SoftwareRequest.asp','InfoFrame','resizable=yes,scrollbars=yes,menubar=yes, top=5, width=550%, height=550, left=2');">
 

Am i missing something. I already tried the 'SoftwareRequest.asp'?<%Department=<% response.write ("Department")%> It just returned the literal. Thanks
0
 
LVL 4

Accepted Solution

by:
anderson22 earned 220 total points
ID: 10741210
From your popup, SoftwareRequest.asp, you can use the following javascript to get the values from the parent window:

opener.document.formname.elementname.value;

You can use this to get the values via client side script.  This means that the values won't be available to your server side code.

Alternately, you can add the code to your onclick submit button.  Something like:

onClick="window.open('SoftwareRequest.asp?NAME=' + document.formnamt.elementname.value + '&NAME2=' + document.formnamt.elementname.value,'InfoFrame','resizable=yes,scrollbars=yes,menubar=yes, top=5, width=550%, height=550, left=2');">

-rca
0
 

Author Comment

by:D_basham
ID: 10743771
Thanks that worked  Perfectly. :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 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