Hi, I'm looking for some help to combine scripts please. I'm only used to working with really basic javascript.
I've got 5 drop downs and an add button, when the 2nd drop down is clicked it shows a hidden drop down on the third and so on till the fifth drop down.
When I click 'add' I want to be able to repeat add rows to the table above the drop downs.
Currently, it writes one new row to my prefered destination table (just above the drop downs), then after running through the drop downs again and clicking 'add' again it adds to the table at the top of the page, which is repeatable.
I can't get repeatable new rows added to the table above the drop downs, only one.
I'd really appreciate some help.
Ian
...........
I've got 5 drop downs and an add button, when the 2nd drop down is clicked it shows a hidden drop down on the third and so on till the fifth drop down.
When I click 'add' I want to be able to repeat add rows to the table above the drop downs.
Currently, it writes one new row to my prefered destination table (just above the drop downs), then after running through the drop downs again and clicking 'add' again it adds to the table at the top of the page, which is repeatable.
I can't get repeatable new rows added to the table above the drop downs, only one.
I'd really appreciate some help.
Ian
...........
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" language="JavaScript"><!--
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}
//--></script>
<script type="text/javascript">
<!--//
function addAction()
{
document.getElementById('addedproduct').value=document.getElementById('problem2').value;
document.getElementById('addedproblem').value=document.getElementById('product2').value;
document.getElementById('addedprocess').value=document.getElementById('process2').value;
}
//-->
</script>
<script type="text/javascript">
function ianinsRow()
{
var x=document.getElementById('ianTable').insertRow(0);
var y=x.insertCell(0);
var z=x.insertCell(1);
var a=x.insertCell(2);
var b=x.insertCell(3);
var c=x.insertCell(4);
y.innerHTML="<input type=\"radio\" name=\"addedradio\" id=\"addedradio\">";
z.innerHTML="<input type=\"text\" name=\"addedproduct\" id=\"addedproduct\" style=\"border:1px solid #000;\">";
a.innerHTML="<input type=\"text\" name=\"addedproblem\" id=\"addedproblem\" style=\"border:1px solid #000;\">";
b.innerHTML="<input type=\"text\" name=\"addedprocess\" id=\"addedprocess\" style=\"border:1px solid #000;\">";
c.innerHTML=" ";
}
</script>
<style type="text/css">
.hide {
display: none;
}
</style>
</head>
<body>
<table id="ianTable" border="1">
<tr>
<td align="left">
</td>
<td align="left">
</td>
<td align="left">
</td>
<td align="left">
</td>
<td align="left"></td>
</tr>
</table>
<br />
<table summary="">
<tbody>
<tr>
<td style="background-color:#eeeeee; text-align:left;">
<b>page title</b>
</td>
<td style="background-color:#eeeeee; text-align:right;">
<b>xxxxxxxx</b>
</td>
</tr>
</tbody>
</table>
<table summary="">
<tbody>
<tr>
<td>
<b>xxxxx xxxxxxxxxx</b>
</td>
<td align="right">
<b>Process</b> Complaints</td>
</tr>
</tbody>
</table>
<table summary="">
<tbody>
<tr>
<td align="left">Mr xxxxxxxxxxx</td>
<td align="left">DOB: xxxxxxxxxxx</td>
</tr>
</tbody>
</table>
<form action="xxxxxxxxxx.htm" name="captureProcessComplaint_CategoriseComplaint" method="POST">
<div style="height: 125px; overflow:auto">
<table>
<tbody>
<tr>
<td align="left" colpan="4">
<b>Issues List</b>
</td>
</tr>
<tr>
<td align="left">
<b>Primary</b>
</td>
<td align="left">
<b>Product</b>
</td>
<td align="left">
<b>Problem</b>
</td>
<td align="left">
<b>Process</b>
</td>
<td align="left"></td>
</tr>
<!-- hidden fields -->
<tr>
<td align="left">
<input type="text" name="addedradio" id="addedradio" style="border:1px solid #fff;">
</td>
<td align="left">
<input type="text" name="addedproduct" id="addedproduct" style="border:1px solid #fff;">
</td>
<td align="left">
<input type="text" name="addedproblem" id="addedproblem" style="border:1px solid #fff;">
</td>
<td align="left">
<input type="text" name="addedprocess" id="addedprocess" style="border:1px solid #fff;">
</td>
<td align="left"></td>
</tr>
</tbody>
</table>
</div>
<table>
<tbody>
<tr>
<td>
<table>
<tr>
<td>
<b>What</b>
</td>
</tr>
<tr>
<td>
<select name="what" multiple="true" size="5">
<option value="NULL">Please select...</option>
<option value="001">Take Money out</option>
<option value="002">Pay Money in</option>
<option value="003">Transfer Money</option>
<option value="004">Change the details on my account / product</option>
</select>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<b>Where</b>
</td>
</tr>
<tr>
<td>
<select name="where" id="where" multiple="true" size="5" onChange="ShowContent('problem2'); HideContent('problem'); return true;">
<option value="NULL">Please select...</option>
<option value="In a Branch">In a Branch</option>
<option value="Using a Cashpoint">Using a Cashpoint</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<b>Problem</b>
</td>
</tr>
<tr>
<td>
<select name="problem" id="problem" multiple="true" size="5" disabled="true">
<option value="">First select option for Where...</option>
</select>
<select class="hide" name="problem2" id="problem2" multiple="true" size="5" onChange="ShowContent('product2'); HideContent('product'); return true;">
<option value="Dummy content to be captured">Dummy content to be captured</option>
<option value="aaaaaaaaaaaaaaaa">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
<option value="bbbbbbbbbbbbbbbbb">bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</option>
</select>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<b>Product</b>
</td>
</tr>
<tr>
<td>
<select name="product" id="product" multiple="true" size="5" disabled="true">
<option value="">First select option for Problem...</option>
</select>
<select class="hide" name="product2" id="product2" multiple="true" size="5" onChange="ShowContent('process2'); HideContent('process'); return true;">
<option value="Dummy content to be captured">Dummy content to be captured</option>
<option value="aaaaaaaaaaaaaaaa">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
<option value="bbbbbbbbbbbbbbbbb">bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</option>
</select>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<b>Process</b>
</td>
</tr>
<tr>
<td>
<select name="process" id="process"multiple="true" size="5" disabled="true">
<option value="">First select option for Product....</option>
</select>
<select class="hide" name="process2" id="process2" multiple="true" size="5" onChange="selectionProcess('process')">
<option value="Dummy content to be captured">Dummy content to be captured</option>
<option value="aaaaaaaaaaaaaaaa">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
<option value="bbbbbbbbbbbbbbbbb">bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<table width="100%">
<tr>
<td align="right" colspan="2">
<input type="button" name="Add" id="Add" value="Add" onClick="addAction(); ianinsRow()">
</td>
<tr></tr>
<td align="left">
<input type="button" id="BackButton" name="BackButton" value="Back" returnCode="BackButton" onClick="document.location='xxxxxx.htm';" class="NavButton">
</td>
<td align="right">
<input type="submit" id="ContinueButton" name="ReturnCode0" value="Continue" returnCode="ReturnCode0" onClick="parent.setReturnCode('ReturnCode0');" class="NavButton">
</td>
</tr>
</table>
<div id="hiddenselectactiondiv" style="visibility: hidden">
<input type="text" id="currentSelectionList" name="currentSelectionList">
<input type="text" id="currentDropdownList" name="currentDropdownList">
<input type="text" id="selectedIssue" name="selectedIssue">
<input type="text" id="whatCode" name="whatCode" value="">
<input type="text" id="whatDescription" name="whatDescription" value="">
<input type="text" id="whereCode" name="whereCode" value="">
<input type="text" id="whereDescription" name="whereDescription" value="">
<input type="text" id="problemCode" name="problemCode" value="">
<input type="text" id="problemDescription" name="problemDescription" value="">
<input type="text" id="productCode" name="productCode" value="">
<input type="text" id="productDescription" name="productDescription" value="">
<input type="text" id="processCode" name="processCode" value="">
<input type="text" id="processDescription" name="processDescription" value="">
<input type="submit" id="AddButton" name="AddButton" value="Add" returnCode="AddButton" onClick="parent.setReturnCode('AddButton');" class="NavButton">
<input type="submit" id="ShowListButton" name="ShowListButton" value="ShowListButton" returnCode="ShowListButton" onClick="parent.setReturnCode('ShowListButton');" class="NavButton">
<input type="submit" id="RemoveButton" name="RemoveButton" value="Remove" returnCode="RemoveButton" onClick="parent.setReturnCode('RemoveButton');" class="NavButton">
</div>
</form>
</body>
</html>