Skip to main content
Visitor II
June 9, 2020
Question

HTML with LWIP

  • June 9, 2020
  • 1 reply
  • 783 views

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

    This topic has been closed for replies.

    1 reply

    Visitor II
    June 10, 2020

    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