• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Enable and disable html elements

Q&A Forum › Category: ESP32 › Enable and disable html elements
0 Vote Up Vote Down
David Huisman asked 2 years ago

Hi,
I have an application using native ESP-IDF for ESP32 that serves a web page.
A pull down list allows users to select either a SINGLE sensor option or DUAL sensor option.
Below the pull down is a number element for Sensor1 and Sensor2.
What I want to do is if user selects SINGLE sensor then Sensor 2 input is disable. If they then say select DUAL sensor then both sensor1 and sensor2 input elements are enabled.
I can enable and disable from javascript but not sure how to trigger my function. I thought also there may be html code that can control another element dependant on its state.
Thanks for any help.

Question Tags: html elements
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
You can make an HTTP request using javascript that will send a request to the ESP32.
Unfortunately, I don’t program using ESP-IDF so I’m not sure how to handle the request on the ESP32 side. But if you know how to handle the request, then you can call the function you want to activate and deactivate the sensors.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.