Hello:
I have 3 javascripts running the form for the ‘Labrador Retriever’ section of the following page: BTW, the forms pass to a shopping cart. All forms work GREAT in this example:
[url]http://www.familycarstickers.us/dogordering1_20_atc_hc.htm
Here’s where the trouble starts ? I want to apply these same JS to another 19 ‘breeds’ of dogs with the same form features on this same page:
Here’s my failed attempt at trying to add another breed (terrier) with the same features of the first, all while trying to pass FULL info to the cart – price, options and price-adjusting options.
[url]http://www.familycarstickers.us/dogordering1_20_atc_hc2.htm
The 3 Javascripts are as follows…I’m not a scripter, obviously, been working at this for a few days and have some great help, but need the functoinality described. Thanks for any clues? LS
<script Language=”JavaScript”>
<!–
function confirm_p1()
{
// Check to see if the dropdown value is is the first choice
if (the_form.p1.selectedIndex == 0)
{
// If the first choice is selected display an alert box
// stating the first choice is not a valid selection
alert(“Please Select a Design”);
// Focus on the dropdown menu after OK is clicked from the alert box
the_form.p1.focus();
return (false);
}
// A choice other than the first was selected
// cotinue processing the form request
return (true);
}
//–></script>
<script type=”text/javascript”>
var Labrador = [
‘Select|[url]http://www.familycarstickers.us/decalimages/labradorret1G.gif
‘Design #1|[url]http://www.familycarstickers.us/decalimages/labradorret1.gif
‘Design #2|[url]http://www.familycarstickers.us/decalimages/labradorret2.gif
‘Design #3|[url]http://www.familycarstickers.us/decalimages/labradorret3.gif
];
var YorkshireTerrier = [
‘Select|[url]http://www.familycarstickers.us/decalimages/terrier1G.gif
‘Design #4|[url]http://www.familycarstickers.us/decalimages/terrier1.gif
‘Design #5|[url]http://www.familycarstickers.us/decalimages/terrier2.gif
‘Design #6|[url]http://www.familycarstickers.us/decalimages/terrier3.gif
];
var GermanShepherd = [
‘Select|[url]http://www.familycarstickers.us/decalimages/GermanShepherd1G.gif
‘Design #7|[url]http://www.familycarstickers.us/decalimages/GermanShepherd1.gif
‘Design #8|[url]http://www.familycarstickers.us/decalimages/GermanShepherd2.gif
‘Design #9|[url]http://www.familycarstickers.us/decalimages/GermanShepherd3.gif
];
var Beagle = [
‘Select|[url]http://www.familycarstickers.us/decalimages/GermanShepherd1G.gif
‘Design #13|[url]http://www.familycarstickers.us/decalimages/beagle1.gif
‘Design #14|[url]http://www.familycarstickers.us/decalimages/beagle2.gif
‘Desing #15|[url]http://www.familycarstickers.us/decalimages/beagle3.gif
];
function Populate(IDS,Arr) {
var f=document.getElementById(IDS);
document.getElementById(IDS).options.length=null;
for (i=0; i<Arr.length; i++) {
tmp = Arr[i].split(‘|’);
document.getElementById(IDS).options[i]=new Option(tmp[0], tmp[0]);
}
}
function selectForm(obj) {
var IDS = obj.id;
var divIDS = obj.selectedIndex;
// document.getElementById(‘test’).innerHTML = IDS+’ | ‘+divIDS; // for testing purposes only
document.getElementById(‘img’+IDS).src = window[IDS][divIDS].split(‘|’)[1];
}
</script>
<script language=”JavaScript”
type=”text/javascript”>
<!–
function showHideTextfield(selIndex,frm){
for (var i=3;i<=3;i++){
if(selIndex<=i-3){
frm[‘p’+i].disabled=true;
}
else{
frm[‘p’+i].disabled=false;
}
}
}
//–>
</script>
</script>