I have a DB-based AMCharts form/page that graphs figures that are entered in a separate edit form accessed from that main page. This latter php edit form is set up to always bring up the present set of entries in every field. This edit form serves two purposes: one is to be able to correct earlier mistakes, and the other is to enter a whole set of new ones. The new figures are entered in this edit page and then submitted. A series of four sets of previous generations are saved in identical tables, which are also graphed on the same main page. A JS div slider script allows the user to compare among 5 generations of separate graphs in the same space. A trigger built into MySql allows each new set to be passed on to older sets, 5 gen deep. Without getting into too many details, the trigger is written so that it is activated if two specific fields in the form are different from the previous. Thus allowing mistakes to be corrected without activating the trigger. With me so far? My question does not concern the structure of the thing, it works fine, but just one problem that does not seem to be available on SO or any other google search result. Specifically, in the case that the edit form is used to enter a brand new set of numbers, how could you use a reset button that activates a script that clears all the old figures from the inputs? I've found numerous answers on SO that use either pure JS or JQuery, but they are not used on PHP forms, rather HMTL forms. Some posters point out that this is anyhow not possible, as edit forms contain DB values cannot be replaced unless the SUBMIT button is used. This simple device is to make entry of new figures easier when they are empty, but I haven't found any scripts so far that succeed in clearing them. The simple reset code that works in HTML forms but in my php one:
<script>function resetform() {
document.getElementById("myform").reset();}</script>
<form action="" method="post" id="myform">
<input value="RESET" onclick="resetform()">