...

View Full Version : combobox question



minglis
04-28-2008, 08:07 PM
using your handy tutorial, i built a combox (see below), my question is why do these links not open in a new window? well really, the question is how do I get them to open in a new window?
Any direction much appreaciated,

Michele:confused:

<form name="lookup">
<p><select name="example" size="1">
<option value="http://www.allergyfoundation.ca" target="_blank">Allergies</option>
<option value="http://www.arthritis.ca" target="_blank">Arthritis</option>
<option value="http://www.asthma.ca" target="_blank">Asthma</option>
<option value="http://www.cancer.ca" target="_blank">Cancer</option>
<option value="http://www.cps.ca" target="_blank">Childrens Health</option>
<option value="http://www.echn.ca" target="_blank">- Online forum</option>
<option value="http://www.canadian-health-network.ca" target="_blank">Complementary Medicine</option>
<option value="http://www.diabetes.ca" target="_blank">Diabetes</option>
<option value="http://www.cfas.ca" target="_blank">Fertility</option>
<option value="http://www.iaac.ca" target="_blank">Fertility</option>
<option value="http://www.infertilitynetwork.org" target="_blank">Infertility Network</option>
<option value="http://www.heartandstroke.ca" target="_blank">Heart Health</option>
<option value="http://www.infectnet.com" target="_blank">Infections & Antibiotics</option>
<option value="http://lung.ca" target="_blank">Lung & Respiratory</option>
<option value="http://www.sogc.org" target="_blank">Menopause</option>
<option value="http://www.cmha.ca" target="_blank">Mental Health</option>
<option value="http://www.motherisk.org" target="_blank">Pregnancy</option>
<option value="http://www.sexualityandu.ca" target="_blank">Sexuality</option>
<option value="http://www.dermatology.ca" target="_blank">Skin Concerns</option>
<option valuef="http://www.strokerecoverycanada.com" target="_blank">Stroke Recovery</option>
<option value="http://www.continence-fdn.ca" target="_blank"><u>Urinary Health</option>
<option value="http://www.cwhn.ca" target="_blank">Womens Health</option>
<option value="http://www.womenshealthmatters.ca" target="_new">Womenshealthmatters.ca</option>
</select></p>

<script language="javascript">
<!--
function go()
{
location=document.lookup.example.
options[document.lookup.example.selectedIndex].value
}
//-->
</script>

<input type="button" name="test" value="Go!" onClick="go()">
</form>

mjlorbet
04-28-2008, 08:19 PM
<script language="javascript">
<!--
function go()
{
window.open(document.lookup.example.
options[document.lookup.example.selectedIndex].value);
}
//-->
</script>



please post your code in between code tags, it's the # sign in the editor



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum