I have a table with chechbox and submit button. when i select some rows and click submit button, that gives me a xml report. I want the rows I previously selected not to be displayed again when I see the table again. I do not want to delete them in the data bank, I just want them not to be displayed anymore. Is there a way to do that in PHP or javascrypt?
UPDATE: that is my table:
<form action="companies.php" method="post" onsubmit='checkform()'>
<table border=2 style="width:1200px";>
<tr>
<td class="ttd"><input type="checkbox" value="<?php echo $ff['ID']; ?>" name="chk[]"> </td>
<td class="ttd"><?php echo htmlentities($ff['ID']); ?> </td>
<td class="ttd"><?php echo htmlentities($ff['Invoice_number']); ?>
<input type="hidden" name="Inum[<?php echo $ff['ID']; ?>]" value="<?php echo $ff['Invoice_number']; ?>"></td>
<td class="ttd"><?php echo htmlentities($ff['Invoice_date']); ?> </td>
<td class="ttd"><?php echo htmlentities($ff['Month']); ?> </td>
<td class="ttd"><?php echo htmlentities($ff['Space_name']); ?>
<input type="hidden" name="Sname[<?php echo $ff['ID']; ?>]" value="<?php echo $ff['Space_name']; ?>"></td>
<td class="ttd"><?php echo htmlentities($ff['Company_name']); ?>
<input type="hidden" name="Cname[<?php echo $kunde['ID']; ?>]" value="<?php echo $ff['Company_name']; ?>"></td>
<td class="ttd"><?php echo htmlentities($ff['Amount']); ?>
<input type="hidden" name="amount[<?php echo $ff['ID']; ?>]" value="<?php echo $ff['Amount']; ?>"></td>
<td class="ttd" style="width:200px;"><?php echo htmlentities($x); ?>
<input type="hidden" name="iban[<?php echo $ff['ID']; ?>]" value="<?php echo $ff['Iban']; ?>"></td>
<td class="ttd"><?php echo htmlentities($ff['BIC']); ?>
<input type="hidden" name="bic[<?php echo $ff['ID']; ?>]" value="<?php echo $ff['BIC']; ?>"></td>
</tr>
</table>
<button type="submit" name="submit" value="submit" onclick='sendit()'>submit</button>
</form>
UPDATE2: script:
document.forms[0].addEventListener("submit", function(event){
if ( send == 0 ) { event.preventDefault(); }
});
function myFunction(el) {
var hidden = el.previousElementSibling;
hidden.style.display = 'block';
hidden.select();
hidden.setSelectionRange(0, 99999)
document.execCommand("copy");
alert("Copied the text: " + hidden.value);
hidden.style.display = 'none';
}
var send = 0;
function sendit(){
send = 1;
console.log(send);
}
function checkform(){
if (send == 1){
console.log(send);
document.form[0].submit();
} else {
return false;
}
}
and companies.php creat a xml FILE.
Aucun commentaire:
Enregistrer un commentaire