ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

How to check the validity of the form when using RadForms? #1336

Closed aquinn637 closed 4 years ago

aquinn637 commented 4 years ago

I'm working on a new NativeScript project with Angular 8.

I have installed this plugin: https://www.npmjs.com/package/nativescript-ui-dataform

I have followed the instructions on this web page: https://docs.nativescript.org/ui/components/DataForm/dataform-overview#editors

How can I check the validity of the form so I can disable the submit button? Also, I need this to be dynamic. E.g. when a field is changed I need this value to update.

Playground: https://play.nativescript.org/?template=play-ng&id=CQnglb&v=2

Here is a code snippet as well:

home page template

home page component

export class HomeComponent implements OnInit {

  ngOnInit(): void {
  }

    public source = {
        username: '',
        password: ''
    };

  public metadata = {
    isReadOnly: false,
    propertyAnnotations: [
      {
        name: 'username',
        displayName: 'Username',
        editor: 'Text',
        validators: [ { name: 'NonEmpty' } ]
      },
      {
        name: 'password',
        displayName: 'Password',
        editor: 'Password',
        validators: [ { name: 'NonEmpty' } ]
      }
    ]
  };
support[bot] commented 4 years ago

:wave: @aquinn637, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please, use Stackoverflow to get help.