...

View Full Version : select + window element



ramli
06-13-2007, 12:14 AM
I want to create a link (<a>) that enables me to send the value of select box with name "test" to a popup window using the header.

for exaple: select box has the value "here". When i click on the link a window opens using "pop-up.html?test=here".

I cant seem to find a tuturial or topic that describes my problem.

I any of u can help me it will be mutch aprisiated.

glenngv
06-13-2007, 12:22 AM
function openPopup(target){
var w=window.open("", target, "width=600, height=400, resizable=1");
w.focus();
return true;
}

<form name="frm" action="pop-up.html" method="get" target="popup" onsubmit="return openPopup(this.target)">
<select name="test">
<option value="blah">This is blah</option>
<option value="foo">This is foo</option>
</select>
<a href="#" onclick="document.frm.submit(); return false;">Open</a>
</form>

ramli
06-13-2007, 12:27 AM
I dont want to submit the form i only want to grab the selectbox value to display some additional information.

I tried:



<a onclick="window.open("", target+document.frm.test, "width=600, height=400, resizable=1");">+</a>


But it doest work correctly yet

glenngv
06-13-2007, 12:45 AM
function openPopup(){
var param = "?test=" + document.frm.test.value;
var w = window.open("pop-up.html" + param, "popup", "width=600, height=400, resizable=1");
w.focus();
return false;
}
<form name="frm">
<select name="test">
<option value="blah">This is blah</option>
<option value="foo">This is foo</option>
</select>
<a href="#" onclick="return openPopup();">More Info</a>
</form>

ramli
06-13-2007, 01:06 AM
Thax that works



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum