...

View Full Version : using Dynamically add funtion for a Tabular Form and posting issue to formtools



bradford789
09-14-2011, 11:18 PM
Hello everyone, i am having a few problems with my form and i was hoping someone can help me understand what i am doing wrong. I'm new to java and scripting for forms. Usually i use Simfatic Forms to build my forms but this form requires special coding and work. I'm build a 5 table form with a dynamically add and remove function that will allow the user to add more Rows to the form.

What i would like the add function to do is allow my users to pick from a Dropdown menu how many rows they would like to add to the form from 1,5,10,15,20,25 rows. I have gotten the form to allow the add function of one row only but i cant get the add function to allow the select from list.

when the row repeats it wont repeat the datepicker to a workable map or the number system from 5+ in table ren5 i have the page up on my site for testing purposes so you can see what is going on.

Another issue im having is when i submit the form to my formtools it takes all the input info and puts it in one line in the datebase. What im trying to do is have each table submit to its own row in the datebase.

What im looking for is help understanding what i need to do to make this work. I have been reading a lot of tutorials and have been searching a lot of help sites but everything i have read and tried so far will not work for what im trying to do.

I really need help getting this to work in the next couple of days. Here is the link to the page on my server so you can see what is going on.http://www.poweronlydispatch.com/FastPostLoad.html

Any help would be very helpful. Thank you all in-advance for your help and understanding off my problem.

Here is the first part of the code

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="development-bundle/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css">
<SCRIPT language="javascript">
function addRow(tableID) {

var table = document.getElementById(tableID);

var rowCount = table.rows.length;
var row = table.insertRow(rowCount);

var colCount = table.rows[0].cells.length;

for(var i=0; i<colCount; i++) {

var newcell = row.insertCell(i);

newcell.innerHTML = table.rows[0].cells[i].innerHTML;
//alert(newcell.childNodes);
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;
}
}
}

function deleteRow(tableID) {
try {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;

for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
if(rowCount <= 1) {
alert("Cannot delete all the rows.");
break;
}
table.deleteRow(i);
rowCount--;
i--;
}

}
}catch(e) {
alert(e);
}
}

</SCRIPT>
<script src="development-bundle/jquery-1.6.2.js"></script>
<script src="development-bundle/ui/jquery.ui.core.js"></script>
<script src="development-bundle/ui/jquery.ui.widget.js"></script>
<script src="development-bundle/ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="development-bundle/demos/demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
showOn: "button",
buttonImage: "development-bundle/demos/images/calendar.gif",
buttonImageOnly: true
});
$( "#datepicker1" ).datepicker({
showOn: "button",
buttonImage: "development-bundle/demos/images/calendar.gif",
buttonImageOnly: true
});
$( "#datepicker2" ).datepicker({
showOn: "button",
buttonImage: "development-bundle/demos/images/calendar.gif",
buttonImageOnly: true
});
$( "#datepicker3" ).datepicker({
showOn: "button",
buttonImage: "development-bundle/demos/images/calendar.gif",
buttonImageOnly: true
});
$( "#datepicker4" ).datepicker({
showOn: "button",
buttonImage: "development-bundle/demos/images/calendar.gif",
buttonImageOnly: true
});
$( "#datepicker5" ).datepicker({
showOn: "button",
buttonImage: "development-bundle/demos/images/calendar.gif",
buttonImageOnly: true
});
});
</script>
<title>Untitled Document</title>

</head>

<body>
<form action="http://www.poweronlydispatch.com/transporters/process.php" method="post" id="FastPostLoad" name="FastPostLoad">
<input type="hidden" name="form_tools_initialize_form" value="1" />
<input type="hidden" name="form_tools_form_id" value="36" />
<table width="100%" cellspacing="0" id="info">
<tr>
<th width="20">&nbsp;</th>
<th width="14">&nbsp;</th>
<th width="110">Pickup Date</th>
<th width="140">Dispatch Number</th>
<th width="120">Trailer Type</th>
<th width="80">Pickup City</th>
<th width="70">Pickup State</th>
<th width="60">Pickup Zip </th>
<th width="80">Delivery City</th>
<th width="80">Delivery State</th>
<th width="60">Delivery Zip</th>
<th width="80">Pay Ammount</th>
<th width="60">Weight</th>
</tr>
</table>
<table id="ren" width="100%" cellspacing="0">
<tr>
<td width="20"><INPUT type="checkbox" name="chk"/></td>
<td width="16"> 1 </td>
<td width="180"><input type="text" name="datepicker" id="datepicker" size="20"></td>
<td width="123"><input name="DispatchNumber" type="text" id="DispatchNumber" size="20"></td>
<td width="148"><input name="TrailerType" type="text" id="TrailerType" size="25"></td>
<td width="91"><input name="PickupCity" type="text" id="PickupCity" size="15"></td>
<td width="89"><select name="PickupState" id="PickupState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="PickupZip" type="text" id="PickupZip" size="10"></td>
<td width="86"><input name="DeliveryCity" type="text" id="DeliveryCity" size="15"></td>
<td width="89"><select name="DeliveryState" id="DeliveryState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="DeliveryZip" type="text" id="DeliveryZip" size="10"></td>
<td width="88"><input name="PayAmount" type="text" id="PayAmount" size="10"></td>
<td width="90"><input name="Weight" type="text" id="Weight" size="10"></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>

bradford789
09-14-2011, 11:22 PM
Here is the second part of the code


<table id="ren2" width="100%" cellspacing="0">
<tr>
<td width="20"><input type="checkbox" name="chk"/></td>
<td width="16">2</td>
<td width="180"><input type="text" name="datepicker" id="datepicker1" size="20" /></td>
<td width="123"><input name="DispatchNumber" type="text" id="DispatchNumber" size="20" /></td>
<td width="148"><input name="TrailerType" type="text" id="TrailerType" size="25" /></td>
<td width="91"><input name="PickupCity" type="text" id="PickupCity" size="15" /></td>
<td width="89"><select name="PickupState" id="PickupState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="PickupZip" type="text" id="PickupZip" size="10" /></td>
<td width="86"><input name="DeliveryCity" type="text" id="DeliveryCity" size="15" /></td>
<td width="89"><select name="DeliveryState" id="DeliveryState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="DeliveryZip" type="text" id="DeliveryZip" size="10" /></td>
<td width="88"><input name="PayAmount" type="text" id="PayAmount" size="10" /></td>
<td width="90"><input name="Weight" type="text" id="Weight" size="10" /></td>
</tr>
<tr>
<td></tbody></td>
</tr>
<tfoot>
</tfoot>
</table>
<table id="ren3" width="100%" cellspacing="0">
<tr>
<td width="20"><input type="checkbox" name="chk"/></td>
<td width="16">3</td>
<td width="180"><input type="text" name="datepicker" id="datepicker2" size="20" /></td>
<td width="123"><input name="DispatchNumber" type="text" id="DispatchNumber" size="20" /></td>
<td width="148"><input name="TrailerType" type="text" id="TrailerType" size="25" /></td>
<td width="91"><input name="PickupCity" type="text" id="PickupCity" size="15" /></td>
<td width="89"><select name="PickupState" id="PickupState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="PickupZip" type="text" id="PickupZip" size="10" /></td>
<td width="86"><input name="DeliveryCity" type="text" id="DeliveryCity" size="15" /></td>
<td width="89"><select name="DeliveryState" id="DeliveryState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="DeliveryZip" type="text" id="DeliveryZip" size="10" /></td>
<td width="88"><input name="PayAmount" type="text" id="PayAmount" size="10" /></td>
<td width="90"><input name="Weight" type="text" id="Weight" size="10" /></td>
</tr>
<tr>
<td></tbody></td>
</tr>
<tfoot>
</tfoot>
</table>
<table id="ren4" width="100%" cellspacing="0">
<tr>
<td width="20"><input type="checkbox" name="chk"/></td>
<td width="16">4</td>
<td width="180"><input type="text" name="datepicker" id="datepicker3" size="20" /></td>
<td width="123"><input name="DispatchNumber" type="text" id="DispatchNumber" size="20" /></td>
<td width="148"><input name="TrailerType" type="text" id="TrailerType" size="25" /></td>
<td width="91"><input name="PickupCity" type="text" id="PickupCity" size="15" /></td>
<td width="89"><select name="PickupState" id="PickupState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="PickupZip" type="text" id="PickupZip" size="10" /></td>
<td width="86"><input name="DeliveryCity" type="text" id="DeliveryCity" size="15" /></td>
<td width="89"><select name="DeliveryState" id="DeliveryState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="DeliveryZip" type="text" id="DeliveryZip" size="10" /></td>
<td width="88"><input name="PayAmount" type="text" id="PayAmount" size="10" /></td>
<td width="90"><input name="Weight" type="text" id="Weight" size="10" /></td>
</tr>
<tr>
<td></tbody></td>
</tr>
<tfoot>
</tfoot>
</table>
<table id="ren5" width="100%" cellspacing="0">
<tr>
<td width="20"><input type="checkbox" name="chk"/></td>
<td width="16">5</td>
<td width="180"><input type="text" name="datepicker" id="datepicker4" size="20" /></td>
<td width="123"><input name="DispatchNumber" type="text" id="DispatchNumber" size="20" /></td>
<td width="148"><input name="TrailerType" type="text" id="TrailerType" size="25" /></td>
<td width="91"><input name="PickupCity" type="text" id="PickupCity" size="15" /></td>
<td width="89"><select name="PickupState" id="PickupState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="PickupZip" type="text" id="PickupZip" size="10" /></td>
<td width="86"><input name="DeliveryCity" type="text" id="DeliveryCity" size="15" /></td>
<td width="89"><select name="DeliveryState" id="DeliveryState" size="1">
<option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option></select></td>
<td width="90"><input name="DeliveryZip" type="text" id="DeliveryZip" size="10" /></td>
<td width="88"><input name="PayAmount" type="text" id="PayAmount" size="10" /></td>
<td width="90"><input name="Weight" type="text" id="Weight" size="10" /></td>
</tr>
<tr>
<td></tbody></td>
</tr>
<tfoot>
</tfoot>
</table>
<p>
<input type="button" value="Add Row" onclick="addRow('ren5')"id="addLoad" />
<select id="addNumLoads" size="1">
<option value="1">1 load</option>
<option value="5">5 loads</option>
<option value="10">10 loads</option>
<option value="15">15 loads</option>
<option value="20">20 loads</option>
<option value="25">25 loads</option>
</select>
&laquo; Add additional loads to post
<input type="button" value="Delete Row" onclick="deleteRow('ren5')">
<input type="submit" name="button" id="button" value="Submit">
</p>
</form>
</body>
</html>

Old Pedant
09-15-2011, 12:13 AM
when i submit the form to my formtools it takes all the input info and puts it in one line in the datebase.
That's by far your bigger problem.

"formtools" (whatever that is) may not understand how to do multiple rows.

Did you write formtools? If not, do you have source code for it? Is it PHP or ASP or JSP or what?

You have to solve that problem before you can worry about cloning the rows.

Old Pedant
09-15-2011, 12:17 AM
Ahhh...and I just noticed that you are using checkboxes for some rows.

That means you almost surely can *NOT* use any generic "formtools". You will need a custom version. Because you will need to *NUMBER* your form fields.

That is, you will need


<table id="ren2" width="100%" cellspacing="0">
<tr>
<td width="20"><input type="checkbox" name="chk2"/></td>
...
<table id="ren3" width="100%" cellspacing="0">
<tr>
<td width="20"><input type="checkbox" name="chk3"/></td>
...
etc.

So that the name of the field has a number that matches the number of the row.

But then *that* means that your "formtools" has to be aware of the numbering and handle it properly.

(This is all because of the way checkboxes are sent from HTML to the server, nothing to do with JavaScript or server-side code. Just a fact of life.)

bradford789
09-15-2011, 12:22 AM
this is the site i got formtools from
http://www.formtools.org

its a program to allow you to have users login in to a part of your website

its all PHP and Mysql so im not sure how to go about changing the source code on that.

If i have to i will make it submit directly to my database and use php to have the submitted info from the form go directly to a searchable datebase. i have a program call PHPmaker that will make all the php files to accomplish this but first i need to solve the problem of the form first before i can do that.

Old Pedant
09-15-2011, 04:14 AM
Trust me, the JavaScript code is trivial. If you don't know PHP coding, that part is going to be MUCH harder. Not atrociously hard, but you will *NOT* find an off-the-shelf program to do it for you. At least not any I'm aware of.

bradford789
10-04-2011, 10:05 AM
well i got the whole form working and posting to my datebase im working on having the info only view able by registered logged in users. here is the link to my form http://www.poweronlydispatch.com/multipleload.php

now my only problem i have is getting the calendar image to position its self to the left of the text field but no mater what i do it keeps positioning under the text field and its driving me nuts



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum