Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this document, you will learn how to use an HTML directive to and get user input and store them into the dynamic data.

...

HTML Directive 

Use the HTML form (above) in the HTML Directive.

Code Block
if(!msg.payload.orbita) {
msg.payload.orbita = {};
}
if(!msg.payload.orbita.directive) {
msg.payload.orbita.directive = [];
}

msg.payload.orbita.directive = 
  [{
    type    : "html5",
    options : 
    {
        // template : "300x300",
        html     : `<form> <label for="fname">First name:</label><br> <input type="text" id="fname" name="fname" value="John"><br> <label for="lname">Last name:</label><br> <input type="text" id="lname" name="lname" value="Doe"><br><br> <button onclick="window.parent.myFunction(event)">Submit</button> </form>`
    }
   }]
return msg;

...