473,382 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Onchange function goes only once

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.selectedIn dex
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!

Jun 14 '07 #1
1 3390
Never mind, I realized that I put only one "=" instead of "==".

Jun 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
2
by: Jeff | last post by:
Hi Everyone, I'm having a problem with onChange. The tag looks like: <input:text bean = "" name="X" label="Y" attributesText="onChange=\"clear()\""> </input:text> if i replace, onChange...
4
by: rick | last post by:
The following basic script works fine in firefox by not in IE. Can anyone spot the problem? In IE I can only delete the first line but not the lines created by javascript. Also, look at the HTML...
4
by: Lynn | last post by:
I have been going round in circles trying to get this to work..... I have a form with many fields, each with an onchange() event. There is also an onclick event on the form Submit button. If one...
8
by: Michelle | last post by:
I have tried every variation of the "onchange" statement below without any actual reloading of the page: The FireFox javaScript Console reports the following message: Error: missing : in...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
1
by: julian.tklim | last post by:
Hi, I've got an input box with popup calendar (date picker) all generated using javascipt. Once a date is selected from the datepicker window, the date value is populated back to the input...
21
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.