PDA

View Full Version : Urgent help - price list not shown up


Cyberoxy
06-29-2011, 11:15 AM
Hey guys / gals

Everything is working expect the price is not shown up.

When I inserted the java code for displaying image when selected item, it is working well but the prices was not shown up. Something with Java. Can you check my below code where is incorrect? Your help much appreciated. I must say it is urgent. Please help me :-)

Look at the red code (insert) below:

<head>
<script type="text/javascript">
window.onload = function() {
document.getElementById("dlist1").onchange = function() {
var option = this.options[this.selectedIndex];
document.getElementById("price_card").innerHTML = option.getAttribute("data-card") ? option.getAttribute("data-card") : "";
document.getElementById("price_memo").innerHTML = option.getAttribute("data-memo") ? option.getAttribute("data-memo") : "";
document.getElementById("price_tags1").innerHTML = option.getAttribute("data-tags1") ? option.getAttribute("data-tags1") : "";
document.getElementById("price_tags4").innerHTML = option.getAttribute("data-tags4") ? option.getAttribute("data-tags4") : "";
document.getElementById("price_key").innerHTML = option.getAttribute("data-key") ? option.getAttribute("data-key") : "";
document.getElementById("price_fridge").innerHTML = option.getAttribute("data-fridge") ? option.getAttribute("data-fridge") : "";
}
}
</script>

<script type="text/javascript">
function swapImage1() {
var image = document.getElementById("imageToSwap1");
var dropd = document.getElementById("dlist1");
image.src = dropd.value;
};
</script>

<script type="text/javascript">
function swapImage2() {
var image = document.getElementById("imageToSwap2");
var dropd = document.getElementById("dlist2");
image.src = dropd.value;
};

</script>

</head>

<body>

<table width="700">

<tr>
<td>
<p class="Card">ORDER 1:</p>

</td>
</tr>
<tr>
<td>
<p class="Dropdown">
<select name="ORDER1" size="12" multiple="multiple" id="dlist1" onchange="swapImage1()">
<optgroup label="Sow Seeds of Love">
<option value="None">None</option>
<option data-card="32.00" data-memo="62.00" data-tags1="8.50" data-tags4="1.80" data-key="30.00" data-fridge="40.00" value="Images/Order_names/SowSeeds/Faith01_yellow.jpg">Faith</option>
<option data-card="35.00" data-memo="65.00" data-tags1="9.50" data-tags4="1.80" data-key="20.00" data-fridge="40.00" value="Images/Order_names/SowSeeds/Grace01_green.jpg">Grace</option>
<option data-card="1.00" data-memo="2.00" data-tags1="3.00" data-tags4="4.00" data-key="5.00" data-fridge="6.00" value="Images/Order_names/SowSeeds/Hope01_blue.jpg">Hope</option>
<option data-card="6.00" data-memo="5.00" data-tags1="4.00" data-tags4="3.00" data-key="2.00" data-fridge="1.00" value="Images/Order_names/SowSeeds/Peace01_pink.jpg">Peace</option>
<option data-card="21.00" data-memo="22.00" data-tags1="23.00" data-tags4="24.00" data-key="25.00" data-fridge="26.00" value="Images/Order_names/SowSeeds/FlowerSeedSachet01_two girls.jpg">Flower Seed</option>
</optgroup>
</select>

</p>

</td>
<td>
<img class="ImageToSwap" id="imageToSwap1" src="Images/DropdownImages.gif" width="147" height="207" />

</td>

</tr>
</table>


//This price list is not shown up.
<table>
<tr>
<th>Description</th>
<th>Price</th>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="card" /> Card A6 (blank)</label></td>
<td id="price_card"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="memo" /> Memo Book A6</label></td>
<td id="price_memo"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="tags4" /> Gift Tags (4 designs per packet)</label></td>
<td id="price_tags4"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="tags1" /> Gift Tags - Single - Assorted</label></td>
<td id="price_tags1"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="key" /> Key Rings Perspex</label></td>
<td id="price_key"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="fridge" /> Fridge Art</label></td>
<td id="price_fridge"></td>
</tr>
</table>


<table width="700">

<tr>
<td>
<p class="Card">ORDER 2:</p>

</td>
</tr>
<tr>
<td>
<p class="Dropdown">
<select name="ORDER2" size="12" multiple="multiple" id="dlist2" onchange="swapImage2()">
<optgroup label="Sow Seeds of Love">
<option value="None">None</option>
<option data-card="32.00" data-memo="62.00" data-tags1="8.50" data-tags4="1.80" data-key="30.00" data-fridge="40.00" value="Images/Order_names/SowSeeds/Faith01_yellow.jpg">Faith</option>
<option data-card="35.00" data-memo="65.00" data-tags1="9.50" data-tags4="1.80" data-key="20.00" data-fridge="40.00" value="Images/Order_names/SowSeeds/Grace01_green.jpg">Grace</option>
<option data-card="1.00" data-memo="2.00" data-tags1="3.00" data-tags4="4.00" data-key="5.00" data-fridge="6.00" value="Images/Order_names/SowSeeds/Hope01_blue.jpg">Hope</option>
<option data-card="6.00" data-memo="5.00" data-tags1="4.00" data-tags4="3.00" data-key="2.00" data-fridge="1.00" value="Images/Order_names/SowSeeds/Peace01_pink.jpg">Peace</option>
<option data-card="21.00" data-memo="22.00" data-tags1="23.00" data-tags4="24.00" data-key="25.00" data-fridge="26.00" value="Images/Order_names/SowSeeds/FlowerSeedSachet01_two girls.jpg">Flower Seed</option>
</optgroup>
</select>

</p>

</td>
<td>
<img class="ImageToSwap" id="imageToSwap2" src="Images/DropdownImages.gif" width="147" height="207" />

</td>

</tr>
</table>

//This price list is also not shown up
<table>
<tr>
<th>Description</th>
<th>Price</th>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="card" /> Card A6 (blank)</label></td>
<td id="Td1"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="memo" /> Memo Book A6</label></td>
<td id="Td2"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="tags4" /> Gift Tags (4 designs per packet)</label></td>
<td id="Td3"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="tags1" /> Gift Tags - Single - Assorted</label></td>
<td id="Td4"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="key" /> Key Rings Perspex</label></td>
<td id="Td5"></td>
</tr>
<tr>
<td><label><input type="radio" name="medium" value="fridge" /> Fridge Art</label></td>
<td id="Td6"></td>
</tr>
</table>

</body>

Thank you
Natz