2020-06-09 10:48 AM
Hello community, I am working on a project for my science class and followed a tutorial online to get lwip up and running and I managed to switch my LED On and Off via my web browser.
My question is I want to "save" a scene with a different button, but can't get it working. Here is a snippet of my code:
<tr>
<td><input value="Program" type="submit"></td>
</tr>
<tr>
<td><input value="SAVE SCENE" type="button" onclick="msg()"></td>
<script><form method="get" action="/leds.cgi"></form>
function msg()
{
alert("Hello world!");
}
</script>
</tr>
I want the button "SAVE SCENE" to call the form-handler (CGIhandler) to execute code that will save the information to a SD Card.
The "Program" button already calls the form-handler and the code executes perfectly, just need to use a second button to execute a second piece of code.
Thanks
2020-06-10 12:17 AM
Hello,
have you tried to use the name attribute of the submit input tag as described here: https://stackoverflow.com/questions/547821/two-submit-buttons-in-one-form