Solved

Passing values of in an form

Posted on 2004-04-01
6
479 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 55 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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/…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now