如何从形式控制值获得入口值

发布于 2025-02-06 19:12:55 字数 198 浏览 1 评论 0原文

我有一个普遍的问题。 我有一个带有视图输入字段的表单。 在输入字段中,我可以设置为姓名,然后可以提交表格。

在第二步中,我可以使用已经填写的输入字段查看此表格,并且可以生成新的空字段。

对于已经填写的输入字段,我想渲染一个按钮,但前提是该字段已经具有先前提交的输入。

我问自己是否有一种方法可以检查输入字段是否已经有输入,并且输入字段已禁用

I have a general question.
I have a form with view input fields.
In the input field I can set for example names and then be able to submit the form.

In the second step, I can view this form with already filled input fields and can generate new empty fields.

For the already filled input fields I would like to render a button but only if the field already has an input from previous submit.

I am asking myself whether there is a way to check whether input field has already an input and the input field is hence disabled

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

和影子一齐双人舞 2025-02-13 19:12:55

是的,有可能有一些方法可以做到这一点。

this.form.value; // It will give you a complete form object.

this.form.get("controlName").value; // it will give yo you the controller value only.

this.form.controls.controlname.value; // it will give yo you the controller value only.

Yes it is possible there are some ways to do it.

this.form.value; // It will give you a complete form object.

this.form.get("controlName").value; // it will give yo you the controller value only.

this.form.controls.controlname.value; // it will give yo you the controller value only.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文