流畅的 uinortstar FormDropdown 使其成为必填字段

发布于 2025-01-13 00:41:09 字数 531 浏览 5 评论 0原文

我们如何才能将 Nortstar 表单中的下拉菜单设为必填字段? 可以这样做吗? 在文本区域和输入组件的 Fluent ui 表单中,我们有必需的字段,因此 onsubmit 会验证输入 表单显示为填写必填字段 https://codesandbox.io/s/zgpqse?module=/example.js

但是对于下拉菜单我们没有这样的东西。我们如何验证带有必填字段的下拉菜单?

我们可以基于钩子禁用提交按钮,但如果我们有一个必填字段那就太好了 https://codesandbox.io/s/cokfqy?module=/example.js

how can we make the the dropdown in the Nortstar Form as a required field?
is it possible to do so ?
in the Fluent ui Form for the textarea and input component we have required Field so onsubmit it validates the input Form shows to fillout for required fields
https://codesandbox.io/s/zgpqse?module=/example.js

But for dropdown we don't have anything as such. how do we validate the Dropdown with required field?

we can disable the submit button based on hooks but it would be good if we have a required field
https://codesandbox.io/s/cokfqy?module=/example.js

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文