I have the following form:
<form method="POST">
Title <input type="text" onchange="Function()">
X <input type="text" onchange="Function()">
Y <input type="text" onchange="Function()">
/* others fields */
</form>
and the test.json file
{
"test":[
{
"title" : "",
"x" : "",
"y" : ""
}
]
}
How do I get a onchange
action on the inputs and the test.json file to be changed and saved automatically on the server?
I'm using PHP, so I'll put the contents of the JSON file into an array:
$jsondados = file_get_contents("test.json");
$json = json_decode($jsondados,true);
Then I can access the array and put it in the variables I want.
I would like suggestions / indications of functions or how to get what is typed in the form to be automatically passed to php variables.