PDA

View Full Version : form acknowlegement



eknp
11-15-2005, 10:43 PM
Hi,

I am using the scripts below in a webform, however, I don't know how to write the content of the array out onto a confirmation page.

Can someone help me write a confirmation page with the data fields listed out on the page.

Thank you very much.

Erica
eknp@hotmail.com


------------------------ web form ------------------
<!-- TWO STEPS TO INSTALL DROPDOWN BOX POPULATION:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<script type="text/javascript">
<!--
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Revised by: DeWayne Whitaker :: http://www.aecdfw.com
Original by: Andrew Berry */

var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[3] = "MON 12/05/2005";
arrItemsGrp1[3] = 3;
arrItems1[4] = "TUE 12/06/2005";
arrItemsGrp1[4] = 3;
arrItems1[5] = "WED 12/07/2005";
arrItemsGrp1[5] = 3;
arrItems1[6] = "THU 12/08/2005";
arrItemsGrp1[6] = 3;
arrItems1[7] = "FRI 12/09/2005";
arrItemsGrp1[7] = 3;
arrItems1[8] = "MON 12/12/2005";
arrItemsGrp1[8] = 3;
arrItems1[9] = "TUE 12/13/2005";
arrItemsGrp1[9] = 3;
arrItems1[10] = "WED 12/14/2005";
arrItemsGrp1[10] = 3;
arrItems1[11] = "THU 12/15/2005";
arrItemsGrp1[11] = 3;
arrItems1[12] = "FRI 12/16/2005";
arrItemsGrp1[12] = 3;

arrItems1[13] = "MON 12/05/2005";
arrItemsGrp1[13] = 2;
arrItems1[14] = "TUE 12/06/2005";
arrItemsGrp1[14] = 2;
arrItems1[15] = "WED 12/07/2005";
arrItemsGrp1[15] = 2;
arrItems1[16] = "THU 12/08/2005";
arrItemsGrp1[16] = 2;
arrItems1[17] = "FRI 12/09/2005";
arrItemsGrp1[17] = 2;
arrItems1[18] = "MON 12/12/2005";
arrItemsGrp1[18] = 2;
arrItems1[19] = "TUE 12/13/2005";
arrItemsGrp1[19] = 2;
arrItems1[20] = "WED 12/14/2005";
arrItemsGrp1[20] = 2;
arrItems1[21] = "THU 12/15/2005";
arrItemsGrp1[21] = 2;
arrItems1[22] = "FRI 12/16/2005";
arrItemsGrp1[22] = 2;

arrItems1[23] = "MON 12/05/2005";
arrItemsGrp1[23] = 1;
arrItems1[24] = "TUE 12/06/2005";
arrItemsGrp1[24] = 1;
arrItems1[25] = "WED 12/07/2005";
arrItemsGrp1[25] = 1;
arrItems1[26] = "THU 12/08/2005";
arrItemsGrp1[26] = 1;
arrItems1[27] = "FRI 12/09/2005";
arrItemsGrp1[27] = 1;
arrItems1[28] = "MON 12/12/2005";
arrItemsGrp1[28] = 1;
arrItems1[29] = "TUE 12/13/2005";
arrItemsGrp1[29] = 1;
arrItems1[30] = "WED 12/14/2005";
arrItemsGrp1[30] = 1;
arrItems1[31] = "THU 12/15/2005";
arrItemsGrp1[31] = 1;
arrItems1[32] = "FRI 12/16/2005";
arrItemsGrp1[32] = 1;



var arrItems2 = new Array();
var arrItemsGrp2 = new Array();

arrItems2[21] = "747";
arrItemsGrp2[21] = 0
arrItems2[22] = "Cessna";
arrItemsGrp2[22] = 0

arrItems2[31] = "Kolb Flyer";
arrItemsGrp2[31] = 1
arrItems2[34] = "Kitfox";
arrItemsGrp2[34] = 1

arrItems2[35] = "Schwietzer Glider";
arrItemsGrp2[35] = 2


arrItems2[101] = "01:00 PM EST";
arrItemsGrp2[101] = 3
arrItems2[102] = "01:30 PM EST";
arrItemsGrp2[102] = 3
arrItems2[103] = "12:00 PM EST";
arrItemsGrp2[103] = 4
arrItems2[104] = "12:30 PM EST";
arrItemsGrp2[104] = 4
arrItems2[105] = "02:00 PM EST";
arrItemsGrp2[105] = 5
arrItems2[106] = "02:30 PM EST";
arrItemsGrp2[106] = 5
arrItems2[107] = "01:00 PM EST";
arrItemsGrp2[107] = 6
arrItems2[108] = "01:30 PM EST";
arrItemsGrp2[108] = 6
arrItems2[109] = "12:00 PM EST";
arrItemsGrp2[109] = 7
arrItems2[110] = "12:30 PM EST";
arrItemsGrp2[110] = 7
arrItems2[111] = "02:00 PM EST";
arrItemsGrp2[111] = 8
arrItems2[112] = "02:30 PM EST";
arrItemsGrp2[112] = 8
arrItems2[113] = "01:00 PM EST";
arrItemsGrp2[113] = 9
arrItems2[114] = "01:30 PM EST";
arrItemsGrp2[114] = 9
arrItems2[115] = "12:00 PM EST";
arrItemsGrp2[115] = 10
arrItems2[116] = "12:30 PM EST";
arrItemsGrp2[116] = 10
arrItems2[117] = "02:00 PM EST";
arrItemsGrp2[117] = 11
arrItems2[118] = "02:30 PM EST";
arrItemsGrp2[118] = 11
arrItems2[119] = "01:00 PM EST";
arrItemsGrp2[119] = 12
arrItems2[120] = "01:30 PM EST";
arrItemsGrp2[120] = 12


arrItems2[121] = "01:00 PM EST";
arrItemsGrp2[111] = 13
arrItems2[122] = "01:30 PM EST";
arrItemsGrp2[122] = 13
arrItems2[123] = "12:00 PM EST";
arrItemsGrp2[123] = 14
arrItems2[124] = "12:30 PM EST";
arrItemsGrp2[124] = 14
arrItems2[125] = "02:00 PM EST";
arrItemsGrp2[125] = 15
arrItems2[126] = "02:30 PM EST";
arrItemsGrp2[126] = 15
arrItems2[127] = "01:00 PM EST";
arrItemsGrp2[127] = 16
arrItems2[128] = "01:30 PM EST";
arrItemsGrp2[128] = 16
arrItems2[129] = "12:00 PM EST";
arrItemsGrp2[129] = 17
arrItems2[130] = "12:30 PM EST";
arrItemsGrp2[130] = 17
arrItems2[131] = "02:00 PM EST";
arrItemsGrp2[131] = 18
arrItems2[132] = "02:30 PM EST";
arrItemsGrp2[132] = 18
arrItems2[133] = "01:00 PM EST";
arrItemsGrp2[133] = 19
arrItems2[134] = "01:30 PM EST";
arrItemsGrp2[134] = 19
arrItems2[135] = "12:00 PM EST";
arrItemsGrp2[135] = 20
arrItems2[136] = "12:30 PM EST";
arrItemsGrp2[136] = 20
arrItems2[137] = "02:00 PM EST";
arrItemsGrp2[137] = 21
arrItems2[138] = "02:30 PM EST";
arrItemsGrp2[138] = 21
arrItems2[139] = "01:00 PM EST";
arrItemsGrp2[139] = 22
arrItems2[130] = "01:30 PM EST";
arrItemsGrp2[130] = 22



arrItems2[131] = "01:00 PM EST";
arrItemsGrp2[131] = 23
arrItems2[132] = "01:30 PM EST";
arrItemsGrp2[132] = 23
arrItems2[133] = "12:00 PM EST";
arrItemsGrp2[133] = 24
arrItems2[134] = "12:30 PM EST";
arrItemsGrp2[134] = 24
arrItems2[135] = "02:00 PM EST";
arrItemsGrp2[135] = 25
arrItems2[136] = "02:30 PM EST";
arrItemsGrp2[136] = 25
arrItems2[137] = "01:00 PM EST";
arrItemsGrp2[137] = 26
arrItems2[138] = "01:30 PM EST";
arrItemsGrp2[138] = 26
arrItems2[139] = "12:00 PM EST";
arrItemsGrp2[139] = 27
arrItems2[140] = "12:30 PM EST";
arrItemsGrp2[140] = 27
arrItems2[141] = "02:00 PM EST";
arrItemsGrp2[141] = 28
arrItems2[142] = "02:30 PM EST";
arrItemsGrp2[142] = 28
arrItems2[143] = "01:00 PM EST";
arrItemsGrp2[143] = 29
arrItems2[144] = "01:30 PM EST";
arrItemsGrp2[144] = 29
arrItems2[145] = "12:00 PM EST";
arrItemsGrp2[145] = 30
arrItems2[146] = "12:30 PM EST";
arrItemsGrp2[146] = 30
arrItems2[147] = "02:00 PM EST";
arrItemsGrp2[147] = 31
arrItems2[148] = "02:30 PM EST";
arrItemsGrp2[148] = 31
arrItems2[149] = "01:00 PM EST";
arrItemsGrp2[149] = 32
arrItems2[150] = "01:30 PM EST";
arrItemsGrp2[150] = 32

function selectChange(control, controlToPopulate, ItemArray, GroupArray) {
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=form.thirdChoice.options.length;q>=0;q--) form.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
// controlToPopulate.add(myEle) ;
controlToPopulate.appendChild(myEle)
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ ) {
if ( GroupArray[x] == control.value ) {
myEle = document.createElement("option") ;
//myEle.value = x ;
myEle.setAttribute('value',x);
// myEle.text = ItemArray[x] ;
var txt = document.createTextNode(ItemArray[x]);
myEle.appendChild(txt)
// controlToPopulate.add(myEle) ;
controlToPopulate.appendChild(myEle)
}
}
}

function selectChange(control, controlToPopulate, ItemArray, GroupArray) {
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=form.thirdChoice.options.length;q>=0;q--) form.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle=document.createElement("option");
theText=document.createTextNode("[SELECT]");
myEle.appendChild(theText);
myEle.setAttribute("value","0");
controlToPopulate.appendChild(myEle);
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ ) {
if ( GroupArray[x] == control.value ) {
myEle = document.createElement("option") ;
//myEle.value = x ;
myEle.setAttribute("value",x);
// myEle.text = ItemArray[x] ;
var txt = document.createTextNode(ItemArray[x]);
myEle.appendChild(txt)
// controlToPopulate.add(myEle) ;
controlToPopulate.appendChild(myEle)
}
}
}
// -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<form name=form>
<table align="center">
<tr>
<td>
<select id="firstChoice" name="firstChoice" onchange="selectChange(this, form.secondChoice, arrItems1, arrItemsGrp1);">
<option value="0" selected>[SELECT]</option>
<option value="1">Overtime</option>
<option value="2">Exempt</option>
<option value="3">Timekeeper</option>
</select>
</td><td>
<select id="secondChoice" name="secondChoice" onchange="selectChange(this, form.thirdChoice, arrItems2, arrItemsGrp2);">
</select>
<select id="thirdChoice" name="thirdChoice">
</select>
</td>
</tr>
</table>
</form>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 5.38 KB -->