Trying to convert program from Delphi to web-based.
Currently I have implemented most of it using HTML/PHP with a bit of javascript that I found online.
However am having problems with part of it.
Basically it is a table. Each row consists of:
Name, checkboxes and date
Once a certain number of checkboxes are checked another (text) field is automatically filled-in with today’s date. Very easy to do in Delphi.
Basic PHP code for each table row is:
echo '<td id="' . $memid . '">' . $name . '<input type="hidden" name="memberid[]" value="' . $memid . '" /></td>'; // checkboxes for ($x = 0; $x < $skills; $x++) { //set defaults if not checked $checked= $dis = ''; $chkval = 0; if ($skillarr[$x] != "0") { $checked = 'checked = "checked"'; $chkval = 1; } echo '<td align="center"><input type="hidden" name="chk[' . $memid . '][]" value = "' . $chkval . '"><input type="checkbox" onclick="this.previousSibling.value=1-this.previousSibling.value" value = "' . $chkval . '" ' . $checked . '" "' . $dis.' ></td>'; } echo '<td align="center"><input type = "text" disabled></td>'; // Passed date goes here - disabled
$skillarr is an array of items which is determined earlier on in the program The skillarr is filled from data table.
Also determined earlier in program is a PHP variable ($required) which is number of items that have to be “passed” (checked) for skill level to be awarded.
Currently loading from datatable, manual use and saving data all works ok
What users want is that as checkboxes are checked the number of checked items is compared to $required and if equal or greater the user is alerted and a message box offers user the ability to mark as level passed, and if so automatically marks all checked items as unavailable, and current date is entered into text box on the same table row, or leave as is (basically an alert with “Skill levels acheived - Accept? [yes] [no]”) - this is what is happening in the Delphi program.
I will admit I do not understand Javascript, and I am sure what I want can be acheived using that language, and would appreciate guidance.Thanks