urgent-how to pass multiple values to the parent form

Reply

Join Date: Feb 2005
Posts: 2
Reputation: aspuser27 is an unknown quantity at this point 
Solved Threads: 0
aspuser27 aspuser27 is offline Offline
Newbie Poster

urgent-how to pass multiple values to the parent form

 
0
  #1
Feb 8th, 2005
hi
in my first form i have a drop down menu.on selecting a choice from it i open the popup.in the popup i display the all types of products avaible in the selected category. he can enter the quantity he wants. now i have some 10 choices in the drop down menu. user can select any product and enter the quantity he wants. ultimately what i want is that when he enters the quantity for product1, product5 or product7 in the popup asp page, i want to display that in the main parent form.how can i dispaly that. i dont need to display in textbox or whatever. but i just it to display below the drop down. how can this be possible

here is the code below in the parent form:
<select onchange="openForm(this);" size="1" name="listData">
<option value="">Select a product type</option>
<option value ="1">Product1</option>
<option value ="2">Product2</option>
etc...

and my function is:
<script>
function openForm(select) {
var itm=select.options[select.selectedIndex].value;
var popup;
popup=window.open("http://localhost/proj/formb.asp?itm="+itm,"form2","toolbar=0,width=300,location=0,status=0,menubar=0");

if (popup) {
if (popup.opener != self) { popup.opener = self; }
} else {
alert("This popup got stopped.");
}
}
</script>

my formb.asp==>
<!-- #include file="conn.config" -->
<script>
function submitForm() {
opener.f.T1.value = "item1";
// close this window
self.close();
}
</script>

<%
tmpNumber = 0
prodID=Request.QueryString("itm")
response.write(prodID)
set rs = db.execute("Select name from tProduct where productID= '" & prodID & "' ")


%>
<table>
<%
do while not rs.eof %>
<tr><td><% Response.Write rs("name") %>: </td>
<td><input type="text" name="T" & tmpNumber size="20">
</td></tr>
<%
rs.movenext
tmpNumber = tmpNumber +1
loop
%>

</table>
<font size="1"><a onClick="submitForm();"><img src="images/submit_btn.gif" border=0></a>
</body>
</font>
<% set rs = nothing
%></html>
i hope i make myself clear because i dont have any area allocated per se in the 1st form. how do i know how many product-tyeps he selected ...if say is choices are:
product product type quantity
Camera handycam 1
Desktop win XP 2

and i have 10 product types....so the popup will change based on the product he selects ... how to trap all the values and display

pls suggest.
thanks
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 86
Reputation: dexterz is an unknown quantity at this point 
Solved Threads: 3
dexterz dexterz is offline Offline
Junior Poster in Training

Re: urgent-how to pass multiple values to the parent form

 
0
  #2
Feb 8th, 2005
Use Request.Form to grab the value from the other page.

popup=window.open("http://localhost/proj/formb.asp?itm=<%Request.Form("ListData")%>,"form2","toolbar=0,width=300,location=0,status=0,menubar=0");

<%
Dim listvalue
listvalue = Trim(Request.Form("ListData"))
If listvalue = "1" Then
Response.Write "Product1"
ElseIf listvalue = "2"
Response.Write "Product2"
ElseIf listvalue = ""
Response.Write "No product selected"
End If
%>
Dexter Zaf
Ex-designz.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC