N
Nick Calladine
Is this possible to ...
I wish to get the value of a dropdown select but gets is indexable value
(dont know if that is the right term) if that is possible (the position it
assigned get assigned by the position on the list)
this is so i can then pass it to the array called pictureimage to get the
correct filename (similar to the picturetext part of this routine) and then
the final line on the fuction is to change an original image with a name of
base to show the case which is selected..
I had the routine originally using the value which was standardcase, case1,
case2, case3 then looking up the value to pass the image information...
i dont know if this is possible...
so if some can advise i be very gratefull
thanks
Nick
// function to change picture and text of case selection
function changepicture()
if (ns4)
{document.myform.dropdownchanger.value=picturetext[document.myform.itemname4.options.selectedIndex]
}
if (ie4) {document.all['dropdownchanger'].innerHTML ='<p>' +
picturetext[document.myform.itemname4.options.selectedIndex] + '</p>' }
else if (dom) {document.getElementById("dropdownchanger").innerHTML ='<p>'
+ picturetext document.myform.itemname4.options.selectedIndex] + '</p>' }
document.base.src=eval((document.myform.itemname4.options[document.myform.itemname4.options.selectedIndex].value))//set up images and link to the filenames pictureimage= new Array()pictureimage[0] = "images/casepackage.jpg"//default pictureimage[1] ="images/a24.jpg" //first pictureimage[2] = "images/a23.jpg" //secondpictureimage[3] = "images/a22.jpg" //third pictureimage[4] ="images/a40a.gif" //forth pictureimage[5] = "images/a42.jpg" //fifthpictureimage[6] = "images/a42.jpg" //sixth pictureimage[7] ="images/a33.jpg" //seventh pictureimage[8] = "images/a41.jpg"//eighth// Insert your text for each picture picturetext= new Array();picturetext[0]="Standard Case Included In Package"; picturetext[1]="Case 1 :8024-C4 All Black Neon Midi Case 400W + £26.50."; picturetext[2]="Case 2 :8024-C34 Black/Silver Neon Midi Case 400W +£26.50."; picturetext[3]="Case 3: 8024-B43 Silver/Black Neon Midi Case 400W +£26.50."; picturetext[4]="Case4 : 8023-B3 All Silver Neon Midi Case 400W +£26.50."; picturetext[5]="Case5 : 8001-C34 Black/Silver Neon Midi Case 400W +£26.50.";picturetext[6]="Case 6 : 8005-B32 Silver/Blue Neon Midi Neon Case 350W+£26.50."; picturetext[7]="Case 7 : 6063-CA Black/Silver Midi Case 400W +£26.50."; picturetext[8]="Case 8 : 8004-C4 All Black Neon Midi Case 400W +£26.50.";<select id="total2" name=itemname4 onchange="changepicture()"size="1"> <option value="standardcase {0.00}" selected>StandardCase</option> <option value="case1 {26.50}">All Black Neon MidiCase</option> <option value="case2 {26.50}">Black/Silver Neon MidiCase400W</option> <option value="case3 {26.50}">Silver/Black Neon MidiCase400W</option> <option value="case4 {26.50}">All Silver Neon MidiCase 400W</option> <option value="case5 {26.50}">Black/Silver Neon MidiCase400W</option> <option value="case6 {26.50}">Silver/Blue Neon MidiNeon Case350W</option> <option value="case7 {26.50}">Black/Silver MidiCase 400W </option> <option value="case8 {26.50}">All Black Neon MidiCase 400W</option></select>
I wish to get the value of a dropdown select but gets is indexable value
(dont know if that is the right term) if that is possible (the position it
assigned get assigned by the position on the list)
this is so i can then pass it to the array called pictureimage to get the
correct filename (similar to the picturetext part of this routine) and then
the final line on the fuction is to change an original image with a name of
base to show the case which is selected..
I had the routine originally using the value which was standardcase, case1,
case2, case3 then looking up the value to pass the image information...
i dont know if this is possible...
so if some can advise i be very gratefull
thanks
Nick
// function to change picture and text of case selection
function changepicture()
if (ns4)
{document.myform.dropdownchanger.value=picturetext[document.myform.itemname4.options.selectedIndex]
}
if (ie4) {document.all['dropdownchanger'].innerHTML ='<p>' +
picturetext[document.myform.itemname4.options.selectedIndex] + '</p>' }
else if (dom) {document.getElementById("dropdownchanger").innerHTML ='<p>'
+ picturetext document.myform.itemname4.options.selectedIndex] + '</p>' }
document.base.src=eval((document.myform.itemname4.options[document.myform.itemname4.options.selectedIndex].value))//set up images and link to the filenames pictureimage= new Array()pictureimage[0] = "images/casepackage.jpg"//default pictureimage[1] ="images/a24.jpg" //first pictureimage[2] = "images/a23.jpg" //secondpictureimage[3] = "images/a22.jpg" //third pictureimage[4] ="images/a40a.gif" //forth pictureimage[5] = "images/a42.jpg" //fifthpictureimage[6] = "images/a42.jpg" //sixth pictureimage[7] ="images/a33.jpg" //seventh pictureimage[8] = "images/a41.jpg"//eighth// Insert your text for each picture picturetext= new Array();picturetext[0]="Standard Case Included In Package"; picturetext[1]="Case 1 :8024-C4 All Black Neon Midi Case 400W + £26.50."; picturetext[2]="Case 2 :8024-C34 Black/Silver Neon Midi Case 400W +£26.50."; picturetext[3]="Case 3: 8024-B43 Silver/Black Neon Midi Case 400W +£26.50."; picturetext[4]="Case4 : 8023-B3 All Silver Neon Midi Case 400W +£26.50."; picturetext[5]="Case5 : 8001-C34 Black/Silver Neon Midi Case 400W +£26.50.";picturetext[6]="Case 6 : 8005-B32 Silver/Blue Neon Midi Neon Case 350W+£26.50."; picturetext[7]="Case 7 : 6063-CA Black/Silver Midi Case 400W +£26.50."; picturetext[8]="Case 8 : 8004-C4 All Black Neon Midi Case 400W +£26.50.";<select id="total2" name=itemname4 onchange="changepicture()"size="1"> <option value="standardcase {0.00}" selected>StandardCase</option> <option value="case1 {26.50}">All Black Neon MidiCase</option> <option value="case2 {26.50}">Black/Silver Neon MidiCase400W</option> <option value="case3 {26.50}">Silver/Black Neon MidiCase400W</option> <option value="case4 {26.50}">All Silver Neon MidiCase 400W</option> <option value="case5 {26.50}">Black/Silver Neon MidiCase400W</option> <option value="case6 {26.50}">Silver/Blue Neon MidiNeon Case350W</option> <option value="case7 {26.50}">Black/Silver MidiCase 400W </option> <option value="case8 {26.50}">All Black Neon MidiCase 400W</option></select>