角色形式,如果p-select与原始值保持不变,则形式无效
我的要求是禁用提交按钮,直到用户更改表单控件的任何任何形式控件为止,问题是很容易处理所需字段的输入字段,但是另一个控件是选择控制,并且基于设置有三个选项,选择了这三个选项中的任何一个,如果用户未更改此选择字段中的选项,则应该禁用提交按钮。是否有任何可以为此提供帮助的内置验证器吗?还是没有任何自定义验证器? 我尝试了很少的验证器,但没有解决
my requirement is to disable the submit button until user changes any of the form control, the issue is the input fields which is a required field is easily handled, however the other control is a select control, and there are three options, based on settings, any of the three options is selected, if the user doesn't change the option in this select field then the submit button should remain disabled. is there any inbuilt validator that can assist for this? or if not any custom validator?
I have tried few validators but it didn't work out
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加验证器。需要到您的选择控件应该足够
Adding Validators.required to your select control should be sufficient
您可以使用
form.valuechanges.subscriber(res => {//您的代码在此处启用并禁用submipt button})
)在反应性表单中,这将有助于您观看表单中的任何更改
you can use
Form.valueChanges.subscribe(res=>{//your code here to enable and disable the submit button})
in reactive formsthis will help you to watch any change in the form