<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Sandy Alexander Page Coupon Specification</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="stylesheet.css" media="all" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
function disableEnableFields(form, i) {
var coupon = i;
if ('form.Coupon' + coupon + '.selectedIndex == 0') {
'form.PriceOption' + coupon + '.disabled=false';
'form.PriceOption' + coupon + '.style.backgroundColor = "#ffffff"';
'form.Coupon' + coupon + '_price.disabled=false';
'form.Coupon' + coupon + '_price.style.backgroundColor = "#ffffff"';
'form.Coupon' + coupon + '_age.disabled=false';
'form.Coupon' + coupon + '_age.style.backgroundColor = "#ffffff"';
}
if ('form.Coupon' + coupon + '.selectedIndex == 2' || 'form.Coupon' + coupon + '.selectedIndex == 3' || 'form.Coupon' + coupon + '.selectedIndex == 5' || 'form.Coupon' + coupon + '.selectedIndex == 15' || 'form.Coupon' + coupon + '.selectedIndex == 16') {
'form.PriceOption' + coupon + '.disabled=true';
'form.PriceOption' + coupon + '.style.backgroundColor = "#dddddd"';
'form.Coupon' + coupon + '_price.disabled=true';
'form.Coupon' + coupon + '_price.style.backgroundColor = "#dddddd"';
'form.Coupon' + coupon + '_age.disabled=true';
'form.Coupon' + coupon + '_age.style.backgroundColor = "#dddddd"';
}
if ('form.Coupon' + coupon + '.selectedIndex == 1' || 'form.Coupon' + coupon + '.selectedIndex == 4' || 'form.Coupon' + coupon + '.selectedIndex == 6' || 'form.Coupon' + coupon + '.selectedIndex == 8' || 'form.Coupon' + coupon + '.selectedIndex == 9' || 'form.Coupon' + coupon + '.selectedIndex == 11' || 'form.Coupon' + coupon + '.selectedIndex == 12' || 'form.Coupon' + coupon + '.selectedIndex == 13' || 'form.Coupon' + coupon + '.selectedIndex == 14') {
'form.PriceOption' + coupon + '.disabled=false';
'form.PriceOption' + coupon + '.style.backgroundColor = "#ffffff"';
'form.Coupon' + coupon + '_price.disabled=false';
'form.Coupon' + coupon + '_price.style.backgroundColor = "#ffffff"';
'form.Coupon' + coupon + '_age.disabled=true';
'form.Coupon' + coupon + '_age.style.backgroundColor = "#dddddd"';
}
if ('form.Coupon' + coupon + '.selectedIndex == 7' || 'form.Coupon' + coupon + '.selectedIndex == 10') {
'form.PriceOption' + coupon + '.disabled=false';
'form.PriceOption' + coupon + '.style.backgroundColor = "#ffffff"';
'form.Coupon' + coupon + '_price.disabled=false';
'form.Coupon' + coupon + '_price.style.backgroundColor = "#ffffff"';
'form.Coupon' + coupon + '_age.disabled=false';
'form.Coupon' + coupon + '_age.style.backgroundColor = "#ffffff"';
}
var value = 'form.Coupon' + coupon + '.selectedIndex.value';
alert ('Coupon = ' + coupon + '\nVariable = form.Coupon' + coupon + '.selectedIndex\nValue = ' + value);
}
function allCouponsSelected (form) {
var coupon1 = form.Coupon1.selectedIndex;
var coupon2 = form.Coupon2.selectedIndex;
var coupon3 = form.Coupon3.selectedIndex;
var coupon4 = form.Coupon4.selectedIndex;
var coupon5 = form.Coupon5.selectedIndex;
var coupon6 = form.Coupon6.selectedIndex;
var coupon7 = form.Coupon7.selectedIndex;
var coupon8 = form.Coupon8.selectedIndex;
var arr = [coupon1, coupon2, coupon3, coupon4, coupon5, coupon6, coupon7, coupon8];
var value = arr[i];
for (var i = 0; i < arr.length - 1; i += 1) {
var value = arr[i];
var j = i + 1;
if (value==0) {
alert('You must select all ' + arr.length + ' coupon offers\n\nPlease select a coupon offer for coupon ' + j);
}
}
}
function catchDupes (form) {
var coupon1 = form.Coupon1.selectedIndex;
var coupon2 = form.Coupon2.selectedIndex;
var coupon3 = form.Coupon3.selectedIndex;
var coupon4 = form.Coupon4.selectedIndex;
var coupon5 = form.Coupon5.selectedIndex;
var coupon6 = form.Coupon6.selectedIndex;
var coupon7 = form.Coupon7.selectedIndex;
var coupon8 = form.Coupon8.selectedIndex;
var arr = [coupon1, coupon2, coupon3, coupon4, coupon5, coupon6, coupon7, coupon8];
var sorted_arr = arr.sort(); // You can define the comparing function here. JS default uses a crappy string compare.
var results = [];
for (var i = 0; i < arr.length - 1; i += 1) {
if (sorted_arr[i + 1] == sorted_arr[i]) {
results.push(sorted_arr[i]);
}
}
if (results!='') {
alert('Duplicate coupon submissions are not permitted\n\nPlease select a different offer for each coupon');
}
}
</script>
</head>
<body>
<div id="wrapper">
<div id="top-menu">
</div>
<div id="content">
<form>
<table align="center" cellpadding="1" cellspacing="1" width="650">
<tr>
<td><h4>Step 2: Specify Coupon</h4></td>
</tr>
</table>
<table align="center" cellpadding="3" cellspacing="2" width="650" frame=box style="background-color: e8eaec;">
<tr>
<td class="formLabelLeft">Coupon 1:</td>
<td><select name="Coupon1" onChange="disableEnableFields(this.form, '1')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption1">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon1_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon1_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 2:</td>
<td><select name="Coupon2" onChange="disableEnableFields(this.form, '2')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption2">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon2_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon2_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 3:</td>
<td><select name="Coupon3" onChange="disableEnableFields(this.form, '3')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption3">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon3_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon3_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 4:</td>
<td><select name="Coupon4" onChange="disableEnableFields(this.form, '4')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption4">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon4_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon4_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 5:</td>
<td><select name="Coupon5" onChange="disableEnableFields(this.form, '5')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption5">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon5_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon5_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 6:</td>
<td><select name="Coupon6" onChange="disableEnableFields(this.form, '6')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption6">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon6_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon6_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 7:</td>
<td><select name="Coupon7" onChange="disableEnableFields(this.form, '7')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption7">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon7_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon7_age" style="width: 45px" /></td>
</tr>
<tr>
<td class="formLabelLeft">Coupon 8:</td>
<td><select name="Coupon8" onChange="disableEnableFields(this.form, '8')">
<option value="">Select Offer</option>
<option value="Offer1">Offer1</option>
<option value="Offer2">Offer2</option>
<option value="Offer3">Offer3</option>
<option value="Offer4">Offer4</option>
<option value="Offer5">Offer5</option>
<option value="Offer6">Offer6</option>
<option value="Offer7">Offer7</option>
<option value="Offer8">Offer8</option>
<option value="Offer9">Offer9</option>
<option value="Offer10">Offer10</option>
<option value="Offer11">Offer11</option>
<option value="Offer12">Offer12</option>
<option value="Offer13">Offer13</option>
<option value="Offer14">Offer14</option>
<option value="Offer15">Offer15</option>
<option value="Offer16">Offer16</option>
</select>
</td>
<td class="formLabelLeft">Price Option Type:</td>
<td><select name="PriceOption8">
<option value="">Select Price Type</option>
<option value="FixedPrice">Fixed Price</option>
<option value="DiscountPrice">Discount Price</option>
<option value="DiscountPercent">Discount Percent</option>
</select>
</td>
<td><input type="text" name="Coupon8_price" style="width: 45px" /></td>
<td class="formLabelLeft">Age Restriction:</td>
<td><input type="text" name="Coupon8_age" style="width: 45px" /></td>
</tr>
</table>
<table align="center" cellpadding="1" cellspacing="1" width="650">
<tr>
<td class="formLabelRight"><input type="button" name="Previous" value="< Previous" /><input type="button" name="Next" value="Next >" onClick="allCouponsSelected(this.form); catchDupes(this.form);" /></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
|