Potrzebuje zrealizowac nastepujaca rzecz. Po wybraniu Sale agent , Ver. Agent urzytkownik powinien miec mozliwosc doania dowlolnej liczby recordow dla lini i broadband
a wynki powinny byc zapisane do tablicy mysql
niestety rezultat
TestCzy jest ktos kto moglby poprawic moj kod tak aby dzialalo albo podac jakis poglad co robie zle
Tak wyglada moj kod strony :
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> var clone;
function cloneDiv(){
var divs=document.getElementById('myDiv').getElementsByTagName('div');
clone=divs[divs.length-1].cloneNode(true);
}
function addDiv(){
var root=document.getElementById('myDiv');
var divs=root.getElementsByTagName('div');
root.appendChild(clone);
clone=divs[divs.length-1].cloneNode(true);
}
onload=cloneDiv
<form id="myForm" action="summary.php" method="post"> <input type="hidden" name="id" />
<table width="200" border="1"> <td>Verification Agent
</td>
<table width="640" height="91" border="1"> <td width="32">Lines
</td> <td width="92">Line status
</td> <td width="68">Broadband
</td> <td width="258">Broadband status
</td> <td><input type="text" name="line" size="4" /></td> <td><input type="text" name="broadband" size="4" /></td> <input name="button" type="button" value="Next Line / Broadband" onclick="addDiv()"> <button type="submit" name="submit" value="submit" />Submit
</button>
a tak php
<?php
if (!$con)
{
}
$sql="INSERT INTO ttest (id, sagent, vagent, lines, lstatus, broadband, bbstatus)
VALUES
('$_POST[id]','$_POST[sagent]','$_POST[vagent]','$_POST[lines]','$_POST[lstatus]','$_POST[broadband]','$_POST[bbstatus]')";
{
}
?>
SQL
CREATE TABLE `NewTable` (
`id` int NULL ,
`sagent` text NULL ,
`vagent` text NULL ,
`lines` int NULL ,
`lstatus` text NULL ,
`broadband` int NULL ,
`bbstatus` text NULL ,
PRIMARY KEY (`id`)
)
;