Onchange function goes only once

B

bkaneweb

Hi,

I was working on a site that uses Google Checkout buy now buttons, and
I wanted the product picture to change based on what was picked. I was
able to have it change the picture, but if you pick a new item after
that, it keeps the same picture. Here;s the code:
The box (only the first part):

<form action="https://checkout.google.com/cws/v2/Merchant/
**************/checkout" id="BB_BuyButtonForm" method="post"
name="BB_BuyButtonForm" onchange="picchange()">
<table cellpadding="5" cellspacing="0" width="1%">
<tr>
<td align="right" width="1%">
<select name="buyButtonCart" "><form action="https://
checkout.google.com/cws/v2/Merchant/*************/checkout"
id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm"
onchange="picchange()">
<table cellpadding="5" cellspacing="0" width="1%">
<tr>
<td align="right" width="1%">
<select name="buyButtonCart" onchange="picchange()">

The function:

<script language="javascript" type="text/javascript">
function picchange()
{
var selecteditem =
document.BB_BuyButtonForm.buyButtonCart.selectedIndex
if (selecteditem="0") {var picname = "Image0.png"}
if (selecteditem="1") {var picname = "Image10.png"}
if (selecteditem="2") {var picname = "Image0.png"}
document.images.pictures.src='/LICF/IMG/' + picname
var picname=""
}
</script>

The photo:
<img src="/LICF/IMG/products.jpg" name="pictures" width="196"
height="156" />

Any help would be great... Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top