I'm using the template below to create a simple web-form to control the lights in my house using the Particle Photon IoT board.
I would like the form to just accept a button-push but not move forward to another page, which it currently does, giving me a response from the device.
I'd like to print the response from the device on the page but not move away from the controls, I'm sure there must be either a basic HTML or more complicated Javascript answer to this, I just don't know it.
Are you able to help at all?
Thanks!
Tim
**UPDATE: Thanks for pointing out the other post. However I have no control over the response from the server (it's not my server) so the solution you found doesn't really help... unless it does and I just don't understand how.
/* Paste the code between the dashes below into a .txt file and save it as an .html file. Replace your-device-ID-goes-here with your actual device ID and your-access-token-goes-here with your actual access token.
---------------------------
<!-- Replace your-device-ID-goes-here with your actual device ID
and replace your-access-token-goes-here with your actual access token-->
<!DOCTYPE>
<html>
<body>
<center>
<br>
<br>
<br>
<form action="https://api.particle.io/v1/devices/987654321/led?access_token=123456789" method="POST">
Tell your device what to do!<br>
<br>
<input type="radio" name="args" value="1">Turn the LED to 1.
<br>
<input type="radio" name="args" value="2">Turn the LED to 2.
<br>
<input type="radio" name="args" value="3">Turn the LED to 3.
<br>
<input type="radio" name="args" value="4">Turn the LED to 4.
<br><br>
<input type="submit" value="Do it!">
</form>
</center>
</body>
</html>
---------------------------
*/