MCPcopy Index your code
hub / github.com/microsoft/SandDance / form

Function form

docs/app/js/sanddance-app.js:142043–142054  ·  view source on GitHub ↗

* Generates an arbitrary input form element. * The input type is controlled via user-provided parameters.

(bind4, el, param, value1)

Source from the content-addressed store, hash-verified

142041 * Generates an arbitrary input form element.
142042 * The input type is controlled via user-provided parameters.
142043 */ function form(bind4, el, param, value1) {
142044 const node = element("input");
142045 for(const key in param)if (key !== "signal" && key !== "element") node.setAttribute(key === "input" ? "type" : key, param[key]);
142046 node.setAttribute("name", param.signal);
142047 node.value = value1;
142048 el.appendChild(node);
142049 node.addEventListener("input", ()=>bind4.update(node.value));
142050 bind4.elements = [
142051 node
142052 ];
142053 bind4.set = (value)=>node.value = value;
142054}
142055/**
142056 * Generates a checkbox input element.
142057 */ function checkbox(bind5, el, param, value2) {

Callers

nothing calls this directly

Calls 2

elementFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected