Avatar for user92178

user92178

Member since Jul 2018 • Last active Dec 2018
  • 1 conversations
  • 4 comments

Most recent activity

  • Avatar for user92178

    Thank you, allObjects. I greatly appreciate your guidance and time and will try the changes you suggest. I am not much of a programmer and only barely know enough to keep my nose above water, but now and then I manage to get my code working. Kind of.

  • Avatar for user92178

    Thank you Gordon, I tried with your changes and it now works as expected. I will try to apply this to my project that involves monitoring and controlling a battery charger. I want to be able to read battery voltage and charge current, display the readings in a table in the web browser and set the charge current and charge voltage remotely. I am using for example the LED1 output to turn the charger on and off. So I was struggling with trying to understand why the webpage would show data that was not updated. I intend to share the code when it is more functional, there may be other people trying to do something similar.

  • Avatar for user92178

    http://www.espruino.com/Posting+Forms
    the original file will by default render the checkbox unchecked. so what I am trying to figure out is if I make a change to the code so that I create a global variable that contains the value that postDATA contains, and I change the HTML code so that the checkbox will follow the value of the postDATA, I would expect this to happen: I connect to the Espruino over wifi. the webpage is loaded (with checkbox unchecked). I click the checkbox so it becomes checked. I click the Submit button, and take the postDATA information that contains the information that the checkbox is checked, and I store this information in a global variable. then - because I modified the HTML so that the page that is loaded now contains a checked checkbox - I would expect that the checkbox would remain checked, but it does not. So I am scratching my head trying to understand why I basically have to repeat the Submit twice (and click the checkbox twice) to make the checkbox stay checked... sorry if my explanation is confusing. I should try to share the code. The main difference from the example code is that I store checkbox status in a variable, and I change the HTML so that the page that is loaded will reflect the status of the variable. I just cannot understand why the second time the page is loaded into the browser, it shows the original unchecked status, not the checked status that the variable contains. it takes a second try (third loading of the HTML) to make the checkbox remain checked.

  • Avatar for user92178

    I tried the demo on my Espruino WiFi 1.1 and it worked as expected. Except I am wondering about that when I click one of the check boxes that control the LEDs, then click Submit, the page is reloaded and the check box value then becomes unchecked.
    Is there a way to modify the code so that a check box stays checked when reloading the page? That could perhaps be done so that the value of the check box is saved and when reloading the page, that check box stays checked?
    that brings me to the question if the page is loaded before or after postDATA is updated?

Actions