View Full Version : Challenge: open window with form value
synerginov
01-17-2001, 03:58 PM
Now this has become a challenge to me. I pass it to experts.. : )
I need to pass the values of a form in a new created window.
simulation:
The user chooses an Item_Number (say:123456) presses GO!... an new window opens (resized, no navigation, no scroll) and the URL launched in THAT window is "http://www.mydomain.com/product.asp?Item_Number=123456"
Challenging huh? Is it possible???
thanks for your help! ; )
kdjoergensen
01-17-2001, 05:32 PM
Try:
function launchWin(){
var num = document.form.inputElement.value;
var url= "mypage.asp?"
var features="resizable,menubar=0,scrollbars=no,location=no,statusbar=no"
mywin= window.open(asp+num,"subWin",features);
mywin.focus();
}
:E
synerginov
01-18-2001, 12:18 AM
is this the way I should implement this? because if so... it does not work . : (
---------------------
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
<title>Test</title>
<Script language="Javascript">
function launchWin(){
var num = document.form.produit.value;
var url= "http://www.MY-DOMAIN.com/test.asp?"
var features="resizable,menubar=0,scrollbars=no,location=no,statusbar=no"
mywin= window.open(asp+num,"subWin",features);
mywin.focus();
}
</Script>
</head>
<body bgcolor="#ffffff">
<form name="form" method="get">
<select name="produit" size="1">
<option value="" selected>Choisissez une couleur</option>
<option value="1234">Cuir Bleu 35-50 E/L</option>
<option value="2345">Cuir Noir 35-50 E/L</option>
<option value="3456">Cuir Blanc 35-50 E/L</option>
</select>
<p><input type="submit" onclick=launchWin()</p>
</form>
</body>
</html>
-----------------------------------
thanks for your help again! : )
Thierry
synerginov
01-18-2001, 08:12 AM
thanks... it works now.. : )
I just had to change one of the variables
('asp' was 'url' in fact ; )
I canged it below.
! I GOT ANOTHER QUESTION ABOUT IT : ), how could I make the script get the name AND the value of the ALL the fields in the form?
as in: http://www.MY-DOMAIN.com/mypage.asp?field1=value1&field2=value2&field3=value3 (etc...)
and also get the value of the button pressed ex: submit=buy or submit=see (which are two different buttons..)
hey.. thanks again for the script. works fine... just needs abit more and I'll be all set : )
Thierry
-------------------------------------
where the script needed fix:
mywin= window.open(url+num,"subWin",features)
synerginov
01-18-2001, 12:30 PM
IT DOES NOT WORK IN NETSCAPE.
The challenge is still alive! ; )
Please help. The window does not open in Netscape.
synerginov
01-18-2001, 01:26 PM
In fact, i've cleaned the specs, the window now opens under NS, but the value for 'produits' is set it to "null".
I'd also like to pass the value of the submit button that was pressed.
any one has a clue?
thanks! ; )
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.