vturner
11-04-2019, 03:54 PM
Hi experts,
On my website, www.vannturner.com, I have 8 combo boxes which list the URLs of retailers (the actual product page) where my novels can be bought.
Index 0 is always the name of the name of the box, eg “Retailers”. Most have Index 1 as Your local bookstore. Both of those have an empty string as arg.
On the onChange event, I am passing as arg the URL to the gothere function. It works just fine for Indexes 2 and greater, but if someone selects Index 1, it opens a copy of my URL in a new window.
How to tell the script that if Index 0 or 1 is selected to do nothing?
WORKS, but does not exclude Index 0 or 1:
<script type="text/javascript">
function gothere(arg){
var arg
newwindow=window.open("")
newwindow.location=arg;
}
</script>
My attempt to exclude the first two items in the box. DOES NOT WORK:
<script type="text/javascript">
function gothere_new(arg){
var arg
if(arg != null && arg.length() < 2) { return;}
else {
newwindow=window.open("")
newwindow.location=arg;
}
}
</script>
I admit I have not studied Java, but have a background in VB and dot.Net. I'm sure my syntax is just wrong.
What is the correction?
Thanks for your help!
Vann
On my website, www.vannturner.com, I have 8 combo boxes which list the URLs of retailers (the actual product page) where my novels can be bought.
Index 0 is always the name of the name of the box, eg “Retailers”. Most have Index 1 as Your local bookstore. Both of those have an empty string as arg.
On the onChange event, I am passing as arg the URL to the gothere function. It works just fine for Indexes 2 and greater, but if someone selects Index 1, it opens a copy of my URL in a new window.
How to tell the script that if Index 0 or 1 is selected to do nothing?
WORKS, but does not exclude Index 0 or 1:
<script type="text/javascript">
function gothere(arg){
var arg
newwindow=window.open("")
newwindow.location=arg;
}
</script>
My attempt to exclude the first two items in the box. DOES NOT WORK:
<script type="text/javascript">
function gothere_new(arg){
var arg
if(arg != null && arg.length() < 2) { return;}
else {
newwindow=window.open("")
newwindow.location=arg;
}
}
</script>
I admit I have not studied Java, but have a background in VB and dot.Net. I'm sure my syntax is just wrong.
What is the correction?
Thanks for your help!
Vann