at the moment I’m using submit input type inside html. But it cause every time a reload of the whole page, when I hit the button. So because of it, I want to use JavaScript now, so my page doesnt reload every time. My problem: I dont know how, and hope someone will help. It’s also possible to use jQuery?
This is my actual html button:
<html>
<body>
<table class="buttons">
<tr>
<td>
<form method="post">
<p> <input name='"Variable".startstop' type="hidden"> </p>
<p> <input class="Start"value="Start" type="submit"> </p>
</form>
</td>
<td>
<form method="post">
<p> <input name='"Variable".startstop'value="0" type="hidden"> </p>
<p> <input class="Stop" value="Stop" type="submit"> </p>
</form>
</td>
</tr>
</table>
</body>
</html>
"Variable.startstop" is inside my plc and I would like to chage it from 1 to 0 and 0 to 1
2
Answers
add id to your form and catch submit
To be specific AJAX is the solution to it, we can also use Fetch API for that. I would recommend using fetch. Before that change, your
type="Submit"
to"type=button"
.