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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass data from form to pop up window 1

Status
Not open for further replies.

hithere

Programmer
Jul 12, 2001
214
US
can't get data from form into pop up this way. want to stay in vbs if possible....clues?

<form method=&quot;POST&quot; action=&quot;new_page_1.asp&quot;>
<p>
<select size=&quot;1&quot; name=&quot;D1&quot;>
<option>red</option>
<option>green</option>
</select><input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;></p>
<SCRIPT Language = &quot;vbscript&quot;>
Sub B1_OnClick()
Window.open &quot;new_page_1.asp&quot;,&quot;window&quot;,&quot;toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=403,height=250,top=200,left=200&quot;
End Sub
</SCRIPT>
</form>

<%
thing=request(&quot;d1&quot;)
response.write thing
%>
&quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Use
Code:
window.showModalDialog
or
Code:
window.showModelessDialog
instead of
Code:
window.Open
as Those 2 methods permits to pass arguments to the opened popup page (2nd calling parameter) That you can retrieve in popup page by the
Code:
window.DialogArguments
property. Water is not bad as long as it stays out human body ;-)
 
so page 1
<form method=&quot;POST&quot; action=&quot;newpage2.asp&quot;>
<p>
<select size=&quot;1&quot; name=&quot;D1&quot;>
<option>red</option>
<option>green</option>
</select><input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;></p>
<SCRIPT Language = &quot;vbscript&quot;>
Sub B1_OnClick()
Window.showmodaldialog &quot;newpage2.asp&quot;,&quot;window&quot;,&quot;toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=403,height=250,top=200,left=200&quot;
End Sub
</SCRIPT>
</form>

page 2
<%
thing = window.DialogArguments(&quot;d1&quot;)
response.write thing
%>

and I get an object required error...thoughts? (thanx for the help!) &quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
You're not there.
Here's what you got to do if you want to get your parameter CLIENT-SIDE (what I though you want to do because you spoke of &quot;VBS&quot;, not &quot;ASP&quot;) :
Code:
<form>
<p>
  <select size=&quot;1&quot; id=&quot;D1&quot;>
    <option value=&quot;R&quot;>red</option>
    <option value=&quot;G&quot;>green</option>
  </select>
  <input type=&quot;button&quot; value=&quot;Submit&quot; onClick=&quot;B1_OnClick&quot;>
</p>

<SCRIPT Language = &quot;vbscript&quot;>
  Sub B1_OnClick()
    dim o_Select, D1_Val
    Set o_Select = document.getElementById(&quot;D1&quot;)
    D1_Val = o_Select.value
    Window.showmodaldialog &quot;newpage2.asp&quot;,&quot;D1=&quot; & D1_Val,&quot;toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=403,height=250,top=200,left=200&quot;
End Sub
</SCRIPT>
</form>

page 2
<SCRIPT Language = &quot;vbscript&quot;>
thing = window.DialogArguments()
msgbox thing
</script>
Now, if you want to get your parameter SERVER-SIDE :
Code:
<form method=&quot;POST&quot; action=&quot;newpage2.asp&quot; ID=&quot;Form1&quot; target=&quot;_blank&quot;>
<p>
  <select size=&quot;1&quot; name=&quot;D1&quot; ID=&quot;D1&quot;>
    <option value=&quot;R&quot;>red</option>
    <option value=&quot;G&quot;>green</option>
  </select>
  <input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot; ID=&quot;Submit1&quot;>
</p>
</form>

page 2
<%
thing = request.form(&quot;D1&quot;)
response.write thing
%>
Water is not bad as long as it stays out human body ;-)
 
thanks targol. star for you! &quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top