Page MenuHomeSealhub

hidden-input.ts
No OneTemporary

hidden-input.ts

import { FlatTemplatable, tempstream } from "tempstream";
import { attribute } from "../../sanitize.js";
import { FormField } from "../fields/field.js";
import { FormControlContext } from "./form-control.js";
import { FormFieldControl } from "./form-field-control.js";
export class HiddenInput extends FormFieldControl {
constructor(public field: FormField) {
super([field]);
}
async render(fctx: FormControlContext): Promise<FlatTemplatable> {
const { raw } = await this.field.getValue(fctx.ctx, fctx.data);
return tempstream`<input type="hidden" name="${
this.field.name
}" value="${attribute((raw || "").toString())}" form="${
fctx.form_id
}">`;
}
}

File Metadata

Mime Type
text/x-java
Expires
Fri, Jan 24, 16:50 (7 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
600915
Default Alt Text
hidden-input.ts (675 B)

Event Timeline