Hi I was wondering if you could help me with my website?
I have the following code that needs to be implemented onto our homepage
HTML Code:
<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>
<table width="511" border="0" align="center">
<tr>
<td width="505" height="153" align="center"><FORM
ACTION="../cgi-bin/redirect.pl"
METHOD=POST onSubmit="return dropdown(this.gourl)">
<p><br>
<br>
<br>
<br>
</p>
<p>
<select name="example" onChange="redirect(this.options.selectedIndex)">
<option>Select Size</option>
<option>Model A ($49.99)</option>
<option>Model B ($69.00)</option>
<option>Model C ($76.80)</option>
<option>Model D ($83.60)</option>
<option>Model E ($89.80)</option>
<option>Model F ($95.60)</option>
</select>
<select name="stage2">
<option value="#">Select a Color</option>
<option value="#">Grey</option>
<option value="#">Blue</option>
</select>
<br>
<br>
<input name="submit2" type="image" id="submit2" src="http://www.boatcoverscover.com/images/stories/buynow.gif" alt="Submit Form" width="174" height="35" border="0">
</p>
</FORM></td>
</tr>
<tr>
<td height="25" align="left" valign="bottom"><div align="left"><a href="#SC"><img src="http://www.boatcoverscover.com/images/stories/semi-custom.gif" alt="" width="132" height="23" border="0"></a></div></td>
</tr>
</table>
<script>
<!--
/*
Double Combo Script Credit
By JavaScript Kit ([URL="http://www.javascriptkit.com"]www.javascriptkit.com[/URL])
Over 200+ free JavaScripts here!
*/
var groups=document.doublecombo.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("Select a Color","#")
group[1][0]=new Option("Select a Color","#")
group[1][1]=new Option("Grey","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=645")
group[1][2]=new Option("Blue","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=1892")
group[2][0]=new Option("Select a Color","#")
group[2][1]=new Option("Grey","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=646")
group[2][2]=new Option("Blue","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=1893")
group[3][0]=new Option("Select a Color","#")
group[3][1]=new Option("Grey","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=647")
group[3][2]=new Option("Blue","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=1894")
group[4][0]=new Option("Select a Color","#")
group[4][1]=new Option("Grey","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=648")
group[4][2]=new Option("Blue","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=1895")
group[5][0]=new Option("Select a Color","#")
group[5][1]=new Option("Grey","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=649")
group[5][2]=new Option("Blue","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=1896")
group[6][0]=new Option("Select a Color","#")
group[6][1]=new Option("Grey","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=650")
group[6][2]=new Option("Blue","http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage-ask.tpl&product_id=1897")
var temp=document.doublecombo.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}
function go(){
location=temp.options[temp.selectedIndex].value
}
//-->
</script>
However it doesn’t seem to work L
But the code that I am currently using, the only difference being that it is a single drop down instead of a double dropdown, works perfectly fine.
<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>
<table width="511" border="0" align="center">
<tr>
<td width="505" height="153" align="center"><FORM
ACTION="../cgi-bin/redirect.pl"
METHOD=POST onSubmit="return dropdown(this.gourl)">
<p><br>
<br>
<br>
<br>
</p>
<p>
<select name="gourl" id="gourl">
<option value="#">Select Model From List</option>
<option value="http://boatcoverscover.com/component/virtuemart/?page=shop.product_details&flypage=flypage.tpl&product_id=645&vmcchk=1">Model A ($49.99)</option>
<option value="http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=646">Model B (add $19.01)</option>
<option value="http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=647">Model C (add $26.81)</option>
<option value="http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=648">Model D (add $33.61)</option>
<option value="http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=649">Model E (add $39.81)</option>
<option value="http://boatcoverscover.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=650">Model F (add $45.61)</option>
</select>
<br>
<br>
<input name="submit2" type="image" id="submit2" src="http://www.boatcoverscover.com/images/stories/buynow.gif" alt="Submit Form" width="174" height="35" border="0">
</p>
</FORM></td>
</tr>
<tr>
<td height="25" align="left" valign="bottom"><div align="left"><a href="#SC"><img src="http://www.boatcoverscover.com/images/stories/semi-custom.gif" alt="" width="132" height="23" border="0"></a></div></td>
</tr>
</table>
I have tried everything I know but still come up with either address not found or it just doesn’t even do anything.
Any help would be much appreciated!
Thanks,
Ryan Loeffler
support@eevelle.com
Last edited by chrishirst; 10-14-2009 at 06:15 PM..
Reason: code delimiters added
|