single submit of 3 columns of table values on a form
Posted: Wed Sep 14, 2016 5:45 pm
Hi, I am curious if what I describe in the next paragraph is possible and if my guess as to how to do it in the paragraph below it is correct.
I want to have a table that is inside a form with 3 columns of the table containing numeric values which I need to fill out for each row (or just change them from the prior values) and once they are all filled out (or changed) I want to submit them with a single submit. I am not an advanced web programmer and the code I have below is the closest I have come to doing this. As you will see it has the table column html code showing at the top with the input being a checkbox rather than a numeric value then the PHP code to process that column is shown below it.
I am guessing I need to set up three html table columns with each column having a separate name to replace foo (for example: foo1or3, foo2of3, for3of3). Next I am assuming I would need to set up three separate loops to process this table similar to what is shown below (a loop for foo1or3, foo2of3, for3of3). The input of the table is the part I am less sure of. I included the code for my guess at the bottom. The part I am really unsure of is how to edit the input values on the client browser rather than wait for to form to be submitted back to php to do the edits.
Any help would be greatly appreciated.
Thanks,
John
THIS IS THE EXTENT OF MY EXPERIENCE:
THIS IS MY HTML TABLE ENTRY GUESS. I PLACED QUESTION MARKS WHERE I DON"T KNOW HOW TO ENTER THE INPUT VALUE TO THE JAVASCRIPT EDIT FUNCTION.
$PriorValue is of course the prior value on the file suggesting that I at times will not make changes to the value and I want them to be submitted as the prior value.
I want to have a table that is inside a form with 3 columns of the table containing numeric values which I need to fill out for each row (or just change them from the prior values) and once they are all filled out (or changed) I want to submit them with a single submit. I am not an advanced web programmer and the code I have below is the closest I have come to doing this. As you will see it has the table column html code showing at the top with the input being a checkbox rather than a numeric value then the PHP code to process that column is shown below it.
I am guessing I need to set up three html table columns with each column having a separate name to replace foo (for example: foo1or3, foo2of3, for3of3). Next I am assuming I would need to set up three separate loops to process this table similar to what is shown below (a loop for foo1or3, foo2of3, for3of3). The input of the table is the part I am less sure of. I included the code for my guess at the bottom. The part I am really unsure of is how to edit the input values on the client browser rather than wait for to form to be submitted back to php to do the edits.
Any help would be greatly appreciated.
Thanks,
John
THIS IS THE EXTENT OF MY EXPERIENCE:
Code: Select all
echo("<td style='background-color:transparent;border:1px #c0c0c0 solid;text-align:left;vertical-align:top;height:18px;' > <input type='checkbox' name='foo[]' value='$fldKF_Key' onclick='funcEditItem($fldKF_Member_LU, $fldMM_Key,$RowCnt)'></td>\n");
// ProcessCheckboxes ========================================================================= ProcessCheckboxes
if (isset($_POST['ProcessCheckboxes'])) {
if (isset($_POST['foo'])) {
$ResultMessage = "";
$TotalAdded = 0;
$TotalBypassed = 0;
foreach($_POST['foo'] as $fldKF_Key){
funcAddItem($fldKF_Key, $fldMM_Key);
}
$ResultMessage = "Add items is complete. Total Added = " . $TotalAdded . " Total Bypassed = " . $TotalBypassed;
}
}
$PriorValue is of course the prior value on the file suggesting that I at times will not make changes to the value and I want them to be submitted as the prior value.
Code: Select all
echo("<td style='background-color:transparent;border:1px #c0c0c0 solid;text-align:left;vertical-align:top;height:18px;' > <input type='text' name='foo1of3[]' value='$PriorValue' onchange='funcEditItem1of3(??????,$RowCnt)'>$PriorValue</td>\n");