ramli
06-12-2007, 11:14 PM
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-12-2007, 11:22 PM
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-12-2007, 11:27 PM
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-12-2007, 11:45 PM
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>