ahs10
08-02-2007, 10:46 PM
so in the code below, if the user is to select the first option (with a value of "xxx") it still opens a new window. why? i want it to only open a window when the value of whichURL is something other than "xxx". i've tried using null, taking away the value of the first option, changing window.open to call a separate function, and a few other things. how can i get my desired results?
<select name="tempGen" size="1" onChange="generate(this.form.tempGen.options)">
<option value="xxx">•••General•••</option>
<option value="templates/General1.html">General One</option>
function generate(whichURL) {
if(whichURL != "xxx") {
window.open(whichURL[whichURL.selectedIndex].value,'POPPER','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable= no,width=200,height=200');
}
}
<select name="tempGen" size="1" onChange="generate(this.form.tempGen.options)">
<option value="xxx">•••General•••</option>
<option value="templates/General1.html">General One</option>
function generate(whichURL) {
if(whichURL != "xxx") {
window.open(whichURL[whichURL.selectedIndex].value,'POPPER','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable= no,width=200,height=200');
}
}