# Send HTML form action from Node Red

**URL:** <https://discourse.nodered.org/t/send-html-form-action-from-node-red/40267>\
**Category:** General\
**Created:** [2 February 2021 21:36 UTC](https://discourse.nodered.org/t/send-html-form-action-from-node-red/40267 "2021-02-02T21:36:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisDeVilliers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisdevilliers/32/36399_2.png) [@ChrisDeVilliers](https://discourse.nodered.org/u/ChrisDeVilliers)\
**Post date:** [2 February 2021 21:36 UTC](https://discourse.nodered.org/t/send-html-form-action-from-node-red/40267/1 "2021-02-02T21:36:11Z")

</div>

Good day everyone,  
I have a networked projector that I am trying to connect to my home automation (Dell 7609WU). It has a simple web interface that uses an HTML form post to turn on and off the projector. While inspecting the html I found this code for the submit action  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/5/b573b8a23f0736b048ffb30e79aec9e4dd51d45a.png)

 == $0 ...many other buttons and things.... == $0

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/902a72a925d782f62bcdce84b6f3745820df8f85.png)

and the power off function is similar.  
Is there any way that I can send these requests from Node Red? I do not have much experiece with php or backend development. Any help will be much appreciated!

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [2 February 2021 22:22 UTC](https://discourse.nodered.org/t/send-html-form-action-from-node-red/40267/2 "2021-02-02T22:22:45Z")

</div>

Try this first in a browser to see if it works:  
[http://YourProjectorIp/tgi/status.tgi&PJSTATE=1&DSP\_SOURCE=121](http://YourProjectorIp/tgi/status.tgi&PJSTATE=1&DSP_SOURCE=121)

If this is working it's not that difficult to implant this in NR.

---

<div class="post-metadata">

**Author:** ![RaviKaushish](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ravikaushish/32/34137_2.png) [@RaviKaushish](https://discourse.nodered.org/u/RaviKaushish)\
**Post date:** [3 February 2021 04:12 UTC](https://discourse.nodered.org/t/send-html-form-action-from-node-red/40267/3 "2021-02-03T04:12:59Z")

</div>

@ChrisDeVilliers You don't need PHP or any serious backend development knowledge/skill to serve a form or receive data from Node-Red.

You can use a get API to serve the HTML form which will post the data to another API on submit (post endpoint) created inside your Node-Red instance.

I have prepared a sample flow. Hope it'd help.

```auto
[{"id":"50aa3bac.85f094","type":"template","z":"cf35282d.677b78","name":"","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n<body>\n\n<h2>HTML Forms</h2>\n\n<form action=\"/users.js\" method=\"post\">\n <label for=\"fname\">First name:</label><br>\n <input type=\"text\" id=\"fname\" name=\"fname\" value=\"John\"><br>\n <label for=\"lname\">Last name:</label><br>\n <input type=\"text\" id=\"lname\" name=\"lname\" value=\"Doe\"><br><br>\n <input type=\"submit\" value=\"Submit\">\n</form> \n\n<p>If you click the \"Submit\" button, the form-data will be sent to a page called \"/action_page.php\".</p>\n\n</body>\n</html>","output":"str","x":300,"y":180,"wires":[["c188911f.179ed"]]},{"id":"3899d94e.d47046","type":"http response","z":"cf35282d.677b78","name":"","statusCode":"","headers":{},"x":490,"y":300,"wires":[]},{"id":"fb731926.862c88","type":"http in","z":"cf35282d.677b78","name":"","url":"/users","method":"get","upload":false,"swaggerDoc":"","x":120,"y":180,"wires":[["50aa3bac.85f094"]]},{"id":"83ede080.8a946","type":"http in","z":"cf35282d.677b78","name":"","url":"/users.js","method":"post","upload":false,"swaggerDoc":"","x":130,"y":300,"wires":[["cd09c56b.60f778"]]},{"id":"cd09c56b.60f778","type":"function","z":"cf35282d.677b78","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":300,"wires":[["3899d94e.d47046","5b596a7.b7d4094"]]},{"id":"c188911f.179ed","type":"http response","z":"cf35282d.677b78","name":"","statusCode":"","headers":{},"x":490,"y":180,"wires":[]},{"id":"5b596a7.b7d4094","type":"debug","z":"cf35282d.677b78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":450,"y":360,"wires":[]}]

```

Best,  
-Ravi

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 April 2021 04:13 UTC](https://discourse.nodered.org/t/send-html-form-action-from-node-red/40267/4 "2021-04-04T04:13:27Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
