First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options within options. I have everything being dynamically named from the previously dynamically named element. (I hope this makes sense.) I am not able to retrieve any of the dynamically created values. I can view them on the source page but can't pull them after submit. I am using a convoluted mix of languages as I am very raw to coding. (ASP, VBScript, JavaScript) So please excuse my ignorance as you will probably see much of. I am sure there is probably an easier way of doing things. :)
I try to retrieve my variables, just to see what i need to disassemble, on the next page with the following code: - <%
-
For i = 1 To Request.Form.Count
-
Response.Write "You selected " & Request.Form(i) & "<br>"
-
Next
-
%>
-
My main page code is as follows: - <%@ LANGUAGE="VBScript" %>
-
<!--#include virtual="/ADOVBS.INC"-->
-
<!-- #INCLUDE FILE = "VB2JSarray2D.inc" -->
-
<!-- #INCLUDE FILE = "VB2JSarray1D.inc" -->
-
<!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">
-
<head>
-
<%
-
strUN = UCase(Request.Form("UN"))
-
strPW = UCase(Request.Form("PW"))
-
%>
-
<%
-
Conn = "dsn=AS400RW;uid=" + strUN + ";pwd=" + strPW + ";"
-
%>
-
<%
-
Set con = Server.CreateObject("ADODB.Connection")
-
con.Open Conn
-
Set cmd = Server.CreateObject("ADODB.Command")
-
Set cmd.ActiveConnection = con
-
%>
-
<%
-
set Recordset = Server.CreateObject("ADODB.Recordset")
-
Recordset.ActiveConnection = Conn
-
Recordset.Source = "SELECT JRIIT#, JRID01, JRID02, JRID03, JRID06 FROM JRITEM WHERE JRID01= 'MOLDING' AND JRIIT# NOT IN(SELECT JRXITM FROM JRCOMP) GROUP BY JRID01, JRID02, JRID03, JRIIT#, JRID06 ORDER BY JRID02"
-
Recordset.Open()
-
%>
-
<%
-
set Recordset1 = Server.CreateObject("ADODB.Recordset")
-
Recordset1.ActiveConnection = Conn
-
Recordset1.Source = "SELECT DISTINCT JRID02, JRID03, JRID06, JRIIT# FROM JRITEM WHERE JRID01 = 'MOLDING' AND JRIUOM = 'FT' AND JRIIT# NOT IN(SELECT JRXITM FROM JRCOMP) order by JRID02, JRID03, JRID06"
-
Recordset1.Open()
-
%>
-
<%
-
set Recordset4 = Server.CreateObject("ADODB.Recordset")
-
Recordset4.ActiveConnection = Conn
-
Recordset4.Source = "SELECT dcsval FROM jritds WHERE dcsgrp='FRAMED AWARD - DC' and dcsseg='INSERT' ORDER BY dcsval"
-
Recordset4.Open()
-
%>
-
<%
-
set Recordset5 = Server.CreateObject("ADODB.Recordset")
-
Recordset5.ActiveConnection = Conn
-
Recordset5.Source = " SELECT JRIIT#, JRID01, JRID02, JRID10 FROM JRITEM WHERE JRID01='GLASS' AND JRID02='PANE' AND JRID07='CLEAR' AND JRIPMB='BUY' AND JRIIT# NOT IN( SELECT JRXITM FROM JRCOMP) GROUP BY JRID01, JRIIT#, JRID10, JRID02 ORDER BY JRID10"
-
Recordset5.Open()
-
%>
-
<%
-
'Create Array
-
Dim InsertArray
-
Set SQLStmt = Server.CreateObject("ADODB.Command")
-
Set RS = Server.CreateObject("ADODB.Recordset")
-
SQLStmt.CommandText = "SELECT dcsval FROM jritds WHERE dcsgrp='FRAMED AWARD - DC' and dcsseg='INSERT' ORDER BY dcsval"
-
SQLStmt.CommandType = 1
-
Set SQLStmt.ActiveConnection = con
-
RS.Open SQLStmt
-
InsertArray = RS.GetRows(, , Array("DCSVAL"))
-
RS.Close
-
-
-
Call ConvertToJSArray2D(InsertArray,"InsertArray")
-
-
%>
-
<%
-
'Create Array
-
Dim MatArray
-
Set SQLStmt = Server.CreateObject("ADODB.Command")
-
Set RS = Server.CreateObject("ADODB.Recordset")
-
SQLStmt.CommandText = "SELECT DISTINCT JRID02, JRID03, JRID04, JRID06, JRIIT# FROM JRITEM A WHERE JRID01 = 'MAT' AND EXISTS(SELECT * FROM VQUOTE WHERE A.JRIIT# = VQQIT#) ORDER BY JRID02"
-
SQLStmt.CommandType = 1
-
Set SQLStmt.ActiveConnection = con
-
RS.Open SQLStmt
-
MatArray = RS.GetRows(, , Array("JRID02", "JRIIT#"))
-
RS.Close
-
-
Call ConvertToJSArray2D(MatArray,"MatArray")
-
%>
-
- <script type="text/javascript">
-
function toggleElement(IDvalue){
-
var divIdName = IDvalue.split("_");
-
document.getElementById(divIdName[0]+"_Square").style.display="none";
-
document.getElementById(divIdName[0]+"_Circle").style.display="none";
-
document.getElementById(divIdName[0]+"_Oval").style.display="none";
-
document.getElementById(divIdName[0]+"_Manual").style.display="none";
-
if(IDvalue!="") {
-
var obj=document.getElementById(IDvalue);
-
obj.style.display=(obj.style.display=="none")? "inline" : "none";
-
}
-
}
-
</script>
-
-
<SCRIPT LANGUAGE="JAVASCRIPT">
-
function matDrop(name) {
-
var html = "<select name='mat"+name+"' id='mat"+name+"'>";
-
html += "<option></option>";
-
var j=0;
-
while (j < MatArray[0].length)
-
{
-
html += "<option name='matstyles' value='"+MatArray[1][j]+"'>"+MatArray[0][j]+"</option>";
-
j=j+1;
-
}
-
html += "</select>";
-
return html;
-
}
-
</SCRIPT>
-
<SCRIPT LANGUAGE="JAVASCRIPT">
-
function insertDrop(num) {
-
var html = "<select name='insert_"+num+"' id='insert_"+num+"'>";
-
html += "<option name='inserttype_"+num+"' value='CallAddFunction'>Needs To Be Added</option>";
-
var j=0;
-
while (j < InsertArray[0].length)
-
{
-
html += "<option name='inserttype_"+num+"' value='"+InsertArray[0][j]+"'>"+InsertArray[0][j]+"</option>";
-
j=j+1;
-
}
-
html += "</select>";
-
return html;
-
}
-
</SCRIPT>
-
<script language="javascript">
-
function cutoutshape(divIdName) {
-
var html = "<select name='shape"+divIdName+"' id='shape"+divIdName+"' onchange=toggleElement(this.value)>";
-
html += "<option></option>";
-
html += "<option name='Square_Rectangle' value='"+divIdName+"_Square'>Square/Rectangle</option>";
-
html += "<option name='Circle' value='"+divIdName+"_Circle'>Circle</option>";
-
html += "<option name='Oval' value='"+divIdName+"_Oval'>Oval</option>";
-
html += "<option name='Manual' value='"+divIdName+"_Manual'>Manual Entry</option>";
-
html += "</select>";
-
return html;
-
}
-
</script>
-
-
<script>
-
function checkMatNumber() {
-
if (currentmatvalue>0)
-
{
-
hide('startmat');
-
}
-
else
-
{
-
show('startmat');
-
}
-
}
-
</script>
-
-
<script type='text/javascript' language='javascript1.2'>
-
initialvalue = 0;
-
currentmatvalue = '';
-
currentinsertvalue = '';
-
</script>
-
-
<script type="text/javascript">
-
function hide(name) {
-
document.getElementById(name).style.visibility = 'hidden';
-
}
-
function show(name) {
-
document.getElementById(name).style.visibility = 'visible';
-
}
-
</script>
-
-
<script type="text/javascript">
-
function removeMat(divNum) {
-
var d = document.getElementById('matDiv');
-
var olddiv = document.getElementById(divNum);
-
d.removeChild(olddiv);
-
currentmatvalue = (currentmatvalue - 1);
-
checkMatNumber();
-
}
-
</script>
-
-
<script type="text/javascript">
-
function StartaddMat() {
-
var ni = document.getElementById('matDiv');
-
var num = (initialvalue -1)+ 2;
-
currentmatvalue = num;
-
var newdiv = document.createElement('div');
-
var divIdName = 'mat'+num+'';
-
var matdropstring = matDrop(divIdName);
-
newdiv.setAttribute('id',divIdName);
-
newdiv.innerHTML = "<b>Mat Number <font color='red'>"+num+"</font> - STYLE:</b> "+matdropstring+" <input class='NavButton' onclick=javascript:removeMat('"+divIdName+"') type='button' value='Delete'><input id='add"+divIdName+"' name='add"+divIdName+"' class='NavButton' onclick=javascript:addMat('add"+divIdName+"');hide('add"+divIdName+"') type='button' value='Add'> <input class='NavButton' id='startcutoutmat"+num+"' name='startcutoutmat"+num+"' onclick=javascript:StartaddCutout('"+divIdName+"') type='button' value='Add A Cutout'><br/><input type='hidden' name='"+divIdName+"currentcutout' id='"+divIdName+"currentcutout'><div id='"+divIdName+"cutoutDiv'></div><br/>";
-
ni.appendChild(newdiv);
-
checkMatNumber();
-
}
-
</script>
-
-
<script type="text/javascript">
-
function addMat(oldMatButton) {
-
var ni = document.getElementById('matDiv');
-
var num = (currentmatvalue -1)+ 2;
-
currentmatvalue = num;
-
var newdiv = document.createElement('div');
-
var divIdName = 'mat'+num+'';
-
var matdropstring = matDrop(divIdName);
-
newdiv.setAttribute('id',divIdName);
-
newdiv.innerHTML = "<b>Mat Number <font color='red'>"+num+"</font> - STYLE:</b> "+matdropstring+" <input class='NavButton' onclick=javascript:removeMat('"+divIdName+"');show('"+oldMatButton+"') type='button' value='Delete'><input id='add"+divIdName+"' name='add"+divIdName+"' class='NavButton' onclick=javascript:addMat('add"+divIdName+"');hide('add"+divIdName+"') type='button' value='Add'> <input class='NavButton' id='startcutoutmat"+num+"' name='startcutoutmat"+num+"' onclick=javascript:StartaddCutout('"+divIdName+"') type='button' value='Add A Cutout'><br/><input type='hidden' name='"+divIdName+"currentcutout' id='"+divIdName+"currentcutout'><div id='"+divIdName+"cutoutDiv'></div><br/>";
-
ni.appendChild(newdiv);
-
checkMatNumber();
-
}
-
</script>
-
-
<script type="text/javascript">
-
function removeCutout(divNum) {
-
var matnumber = divNum.split('cutout');
-
var mat = matnumber[0];
-
var d = document.getElementById(mat+'cutoutDiv');
-
var dv = d.id;
-
var olddiv = document.getElementById(divNum);
-
d.removeChild(olddiv);
-
var currentcutouttext = document.getElementById(mat+'currentcutout');
-
var currentcutoutvalue = currentcutouttext.value;
-
currentcutoutvalue = (currentcutoutvalue - 1);
-
document.getElementById(mat+'currentcutout').value = currentcutoutvalue;
-
checkCutoutNumber(mat);
-
}
-
</script>
-
-
<script type="text/javascript">
-
function StartaddCutout(mat) {
-
var ni = document.getElementById(mat+'cutoutDiv');
-
var num = (initialvalue -1)+ 2;
-
var currentcutouttext = document.getElementById(mat+'currentcutout');
-
currentcutouttext.value = num
-
var newdiv = document.createElement('div');
-
var divIdName = mat+'cutout'+num+'Div';
-
newdiv.setAttribute('id',divIdName);
-
var shape = cutoutshape(divIdName);
-
newdiv.innerHTML = "<b>Please select the shape of cutout <font color='red'>"+num+"</font>:</b> "+shape+" <input class='NavButton' onclick=javascript:removeCutout('"+divIdName+"') type='button' value='Delete'><input id='"+divIdName+"Button' name='"+divIdName+"Button' class='NavButton' onclick=javascript:addCutout('"+mat+"','"+divIdName+"');hide('"+divIdName+"Button') type='button' value='Add'><div id='"+divIdName+"'></div><div style='display: none' id='"+divIdName+"_Square'>Side 1: <input id='"+divIdName+"Side1'>IN X <input id='"+divIdName+"Side2'>IN</div><div style='display: none' id='"+divIdName+"_Circle'>Radius: <input id='"+divIdName+"Radius'>IN</div><div style='display: none' id='"+divIdName+"_Oval'>Radius 1: <input id='"+divIdName+"Radius1'>IN X <input id='"+divIdName+"Radius2'>IN</div><div style='display: none' id='"+divIdName+"_Manual'>Manual Calculation: <input id='"+divIdName+"Man'>IN</div><br/>";
-
ni.appendChild(newdiv);
-
checkCutoutNumber(mat);
-
}
-
</script>
-
-
<script type="text/javascript">
-
function addCutout(oldmat,mat) {
-
var matnumber = oldmat.split("cut");
-
var ni = document.getElementById(matnumber[0]+'cutoutDiv');
-
var currentcutoutvalue = document.getElementById(matnumber[0]+'currentcutout').value;
-
var num = (currentcutoutvalue -1)+ 2;
-
var currentcutouttext = document.getElementById(matnumber[0]+'currentcutout');
-
currentcutouttext.value = num
-
var newdiv = document.createElement('div');
-
var divIdName = matnumber[0]+'cutout'+num+'Div';
-
newdiv.setAttribute('id',divIdName);
-
var shape = cutoutshape(divIdName);
-
newdiv.innerHTML = "<b>Please select the shape of cutout <font color='red'>"+num+"</font>:</b> "+shape+" <input class='NavButton' onclick=javascript:removeCutout('"+divIdName+"');show('"+mat+"Button') type='button' value='Delete'><input id='"+divIdName+"Button' name='"+divIdName+"Button' class='NavButton' onclick=javascript:addCutout('"+oldmat+"','"+divIdName+"');hide('"+divIdName+"Button') type='button' value='Add'><div id='"+divIdName+"'></div><div style='display: none' id='"+divIdName+"_Square'>Side 1: <input id='"+divIdName+"Side1'>IN X <input id='"+divIdName+"Side2'>IN</div><div style='display: none' id='"+divIdName+"_Circle'>Radius: <input id='"+divIdName+"Radius'>IN</div><div style='display: none' id='"+divIdName+"_Oval'>Radius 1: <input id='"+divIdName+"Radius1'>IN X <input id='"+divIdName+"Radius2'>IN</div><div style='display: none' id='"+divIdName+"_Manual'>Manual Calculation: <input id='"+divIdName+"Man'>IN</div><br/>";
-
ni.appendChild(newdiv);
-
checkCutoutNumber(matnumber[0]);
-
}
-
</script>
-
-
<script>
-
function checkCutoutNumber(mat) {
-
var currentcutoutvalue = document.getElementById(mat+'currentcutout').value;
-
if (currentcutoutvalue>0)
-
{
-
hide('startcutout'+mat+'');
-
}
-
else
-
{
-
show('startcutout'+mat+'');
-
}
-
}
-
</script>
-
-
<script type="text/javascript">
-
function removeInsert(divNum) {
-
var d = document.getElementById('insertDiv');
-
var olddiv = document.getElementById(divNum);
-
d.removeChild(olddiv);
-
currentinsertvalue = (currentinsertvalue - 1);
-
checkInsertNumber();
-
}
-
</script>
-
-
<script type="text/javascript">
-
function StartaddInsert() {
-
var ni = document.getElementById('insertDiv');
-
var num = (initialvalue -1)+ 2;
-
currentinsertvalue = num;
-
var newdiv = document.createElement('div');
-
var divIdName = 'insert'+num+'Div';
-
newdiv.setAttribute('id',divIdName);
-
newdiv.innerHTML = "<b>Insert <font color='red'>"+num+"</font> Item Number:</b> <input type='text' id='"+divIdName+"_number'> <input class='NavButton' onclick=javascript:removeInsert('"+divIdName+"') type='button' value='Delete'> <input id='"+divIdName+"_add' name='"+divIdName+"_add' class='NavButton' onclick=javascript:addInsert('"+divIdName+"_add');hide('"+divIdName+"_add') type='button' value='Add'><br /> Insert "+num+" Type: "+insertDrop(num)+" <br /><font color='red'>If it needs to be added, enter the type here:</font> <input type='text' id='"+divIdName+"_Insert' name='"+divIdName+"_Insert'></input><br />Insert Size: <input type=text name='"+divIdName+"_size1' id='"+divIdName+"_size1'></input>IN X <input type=text name='"+divIdName+"_size2' id='"+divIdName+"_size2'></input>IN<br /><br />";
-
ni.appendChild(newdiv);
-
checkInsertNumber();
-
}
-
</script>
-
-
<script type="text/javascript">
-
function addInsert(oldDivNum) {
-
var ni = document.getElementById('insertDiv');
-
var num = (currentinsertvalue -1)+ 2;
-
currentinsertvalue = num;
-
var newdiv = document.createElement('div');
-
var divIdName = 'insert'+num+'Div';
-
newdiv.setAttribute('id',divIdName);
-
newdiv.innerHTML = "<b>Insert <font color='red'>"+num+"</font> Item Number:</b> <input type='text' id='"+divIdName+"_number'> <input class='NavButton' onclick=javascript:removeInsert('"+divIdName+"');show('"+oldDivNum+"') type='button' value='Delete'> <input id='"+divIdName+"_add' name='"+divIdName+"_add' class='NavButton' onclick=javascript:addInsert('"+divIdName+"_add');hide('"+divIdName+"_add') type='button' value='Add'><br /> Insert "+num+" Type: "+insertDrop(num)+" <br /><font color='red'>If it needs to be added, enter the type here:</font> <input type='text' id='"+divIdName+"_Insert' name='"+divIdName+"_Insert'></input><br />Insert Size: <input type=text name='"+divIdName+"_size1' id='"+divIdName+"_size1'></input>IN X <input type=text name='"+divIdName+"_size2' id='"+divIdName+"_size2'></input>IN<br /><br />";
-
ni.appendChild(newdiv);
-
checkInsertNumber();
-
}
-
</script>
-
-
<script>
-
function checkInsertNumber() {
-
if (currentinsertvalue>0)
-
{
-
hide('startinsert');
-
}
-
else
-
{
-
show('startinsert');
-
}
-
}
-
</script>
-
[HTML]
<link rel="stylesheet" type="text/css" href="css/main.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>MTM Intranet - DCME Framebuilder</title>
</head>
<BODY>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="maintable">
<tr>
<td width="107">
<img src="images/logo.gif" width="107" height="80" border="0">
</td>
<td width="529">
<b><font size="5">Frame Builder - Options</font></b>
</td>
<td width="134" valign="middle">
<p align="center">
<img border="0" src="images/frame.gif" width="134" height="100">
</td>
</tr>
<tr>
<td colspan="3">
<table class="middle" width="100%" border="0" cellspacing="0" cellpadding="0">
</td>
</tr>
<tr>
<td class="header">
Enter the frame information here...
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<img src="images/line.gif" width="100%" height="1">
</td>
</tr>
<tr>
<td>
<table width="75%" border="0" align="center">
<form name="form" id="form" action="test.asp" method="post">
<table width="100%" border="1" style="border-collapse: collapse" bordercolor="#000000">
<th colspan="4" bgcolor="#CCCCCC">Basic Sizing</th>
<tr colspan="4">
<th colspan="2">Inside Dimensions</th><th colspan="2">Outside Dimensions</th>
</tr>
<tr>
<th>Side 1</th><th>Side 2</th><th>Side 1</th><th>Side 2</th>
</tr>
<tr align="center">
<td>
<input type="text" name="id1" id="id1">IN
</td>
<td>
<input type="text" name="id2" id="id2">IN
</td>
<td>
<input type="text" name="od1" id="od1">IN
</td>
<td>
<input type="text" name="od2" id="od2">IN
</td>
</tr>
<th colspan="4" bgcolor="#CCCCCC">Variable Options</th>
<tr align="center">
<td colspan="2"><b>Glass Pane Stock Size:
</b>
<select name="glass">
<option></option>
[/HTML]
- <%
-
Do While Not Recordset5.EOF
-
%>
[HTML]
<option name="glass" value="<%= Recordset5.Fields.item("JRIIT#").value %>"><%= Recordset5.Fields.item("JRID10").value %></option>
<%
Recordset5.MoveNext
Loop
%>
</select>
</td>
<td colspan="2">
<b>Foam Core:
</b>
<input type="radio" name="foamcore" id="foamcore" value="black" style="font-weight: 700">Black<b> & nbsp; </b><input checked="yes" type="radio" name="foamcore" id="foamcore" value="white" style="font-weight: 700">White<b>
</b>
</td>
</tr>
<th colspan="4" bgcolor="#CCCCCC">Molding Style</th>
<tr align="center">
<td colspan="4">
<select TabIndex="2" name="molding">
<option></option>
<%
Do While Not Recordset1.EOF
%>
<option name="molding" value="<%= Recordset1.Fields.item("JRIIT#").value %>"><%= Recordset1.Fields.item("JRID02").value %> - <%= Recordset1.Fields.item("JRID03").value %> - <%= Recordset1.Fields.item("JRID06").value %></option>
<%
Recordset1.MoveNext
Loop
%>
</select>
</td>
</tr>
<th colspan="4" bgcolor="#CCCCCC">Mat Information</th>
<tr align="center">
<td colspan="4">
<input type="hidden" value="0" id="matValue" />
<input class='NavButton' id='startmat' name='startmat' onclick='StartaddMat();' type='button' value='Add A Mat'>
<div id="matDiv">
</div>
</td>
</tr>
<th colspan="4" bgcolor="#CCCCCC">Insert Information</th>
<tr align="center">
<td colspan="4">
<input type="hidden" value="0" id="insertValue" />
<input class='NavButton' id='startinsert' name='startinsert' onclick='StartaddInsert();' type='button' value='Add An Insert'>
<div id="insertDiv">
</div>
</td>
</tr>
<tr height="100"><td colspan="4"> </td></tr>
<tr>
<td colspan="4" align="center">
<input type="submit" id="submit" value="Make A Frame">
</td>
</tr>
</table>
<table width="100%">
<input type="hidden" name="UN" value="<%= strUN %>">
<input type="hidden" name="PW" value="<%= strPW %>">
</table>
<script type="text/javascript">
//var x=document.getElementById("form");
//for (var i=0;i<x.length;i++)
// {
// document.write(x.elements[i].value);
// document.write("<br />");
// }
</script>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>[/HTML]