lilpete
09-17-2010, 11:11 AM
Hi Guys and Girls,
I am not sure if I am being cheeky here but I need some Javascript written for me as I dont have the skills to do it.
Here is the problem:
I have a comma seperated list of sizes and I need to get from that a radio button group to select a size.
Page is here:-
http://www.test.steptoes.co.uk/product-display_El-Naturalista-N400_dGFibGU9cHJvZHVjdCZmaWVsZD1Db2RlMSZ2YWx1ZT1ONDAw.ghtml
That is the way the sizes are stored in the database, they are called with a little bit of code in the original HTML: [_own Size_]
<div id="sizes">
[_own Size_]<br /><br />
<input type="submit" name="action" value="Add to Basket" class="button">
</div>
Is there any chance someone could find the time to write me such a script?
I did have a similar one to turn it into a list, but it was not written by me:-
function changeSize(list,item) {
var id = item.options[item.selectedIndex].value;
var sizes = document.getElementById("sizes_" + id).value;
sizesArray = sizes.split(",");
//id = sizesArray.splice(0,1);
//item.options[item.selectedIndex].value = id;
list.length = 0;
list[0] = new Option("Choose","");
for (n=0;n<sizesArray.length;n++){
list[n+1] = new Option(sizesArray[n],sizesArray[n]);
}
list.focus()
}
Any help on this would much appreciated.
Best Regards,
Pete
I am not sure if I am being cheeky here but I need some Javascript written for me as I dont have the skills to do it.
Here is the problem:
I have a comma seperated list of sizes and I need to get from that a radio button group to select a size.
Page is here:-
http://www.test.steptoes.co.uk/product-display_El-Naturalista-N400_dGFibGU9cHJvZHVjdCZmaWVsZD1Db2RlMSZ2YWx1ZT1ONDAw.ghtml
That is the way the sizes are stored in the database, they are called with a little bit of code in the original HTML: [_own Size_]
<div id="sizes">
[_own Size_]<br /><br />
<input type="submit" name="action" value="Add to Basket" class="button">
</div>
Is there any chance someone could find the time to write me such a script?
I did have a similar one to turn it into a list, but it was not written by me:-
function changeSize(list,item) {
var id = item.options[item.selectedIndex].value;
var sizes = document.getElementById("sizes_" + id).value;
sizesArray = sizes.split(",");
//id = sizesArray.splice(0,1);
//item.options[item.selectedIndex].value = id;
list.length = 0;
list[0] = new Option("Choose","");
for (n=0;n<sizesArray.length;n++){
list[n+1] = new Option(sizesArray[n],sizesArray[n]);
}
list.focus()
}
Any help on this would much appreciated.
Best Regards,
Pete