angular: disableOnInvalid: true doesn't disable the Submit button

Hi,

I have embedded a formio form in a angular 4 application generated using angular-cli (1.x.x) using angular-formio ( upgraded from ng2-form ) and my form configuration has disableOnInvalid: true but upon rendering the form, the submit button isn’t disabled. Even when invalid fields errors are triggered, the form isn’t being disabled. Let me know if you need more info.

Angular form io version used: 0.13.0

Form component included in html like this:

<formio (submit)="onComplete($event)" [options]="options" [src]="url"></formio>

Here is the form:

{
	"_id": "xxx",
	"machineName": "xxx",
	"modified": "2017-08-22T06:39:13.153Z",
	"title": "Add User",
	"display": "form",
	"name": "addUser",
	"path": "reg",
	"project": "xxx",
	"created": "2017-08-22T02:41:24.987Z",
	"components": [{
		"description": "",
		"properties": {
			"": ""
		},
		"tags": [],
		"type": "textfield",
		"conditional": {
			"eq": "",
			"when": null,
			"show": ""
		},
		"validate": {
			"customPrivate": false,
			"custom": "",
			"pattern": "",
			"maxLength": "",
			"minLength": 2,
			"required": true
		},
		"clearOnHide": true,
		"hidden": false,
		"persistent": true,
		"unique": false,
		"protected": false,
		"defaultValue": "",
		"multiple": false,
		"suffix": "",
		"prefix": "",
		"placeholder": "Enter Firstname...",
		"key": "firstName",
		"label": "First Name:",
		"inputMask": "",
		"inputType": "text",
		"tableView": true,
		"input": true
	}, {
		"properties": {
			"": ""
		},
		"tags": [],
		"type": "textfield",
		"conditional": {
			"eq": "",
			"when": null,
			"show": ""
		},
		"validate": {
			"customPrivate": false,
			"custom": "",
			"pattern": "",
			"maxLength": "",
			"minLength": 2,
			"required": true
		},
		"clearOnHide": true,
		"hidden": false,
		"persistent": true,
		"unique": false,
		"protected": false,
		"defaultValue": "",
		"multiple": false,
		"suffix": "",
		"prefix": "",
		"placeholder": "Enter Last name...",
		"key": "lastName",
		"label": "Last Name",
		"inputMask": "",
		"inputType": "text",
		"tableView": true,
		"input": true
	}, {
		"validate": {
			"required": true
		},
		"properties": {
			"": ""
		},
		"conditional": {
			"eq": "",
			"when": null,
			"show": ""
		},
		"tags": [],
		"type": "email",
		"kickbox": {
			"enabled": false
		},
		"clearOnHide": true,
		"hidden": false,
		"persistent": true,
		"unique": false,
		"protected": false,
		"defaultValue": "",
		"suffix": "",
		"prefix": "",
		"placeholder": "Enter Email Address ...",
		"key": "email",
		"label": "Email Address",
		"inputType": "email",
		"tableView": true,
		"input": true
	}, {
		"validate": {
			"minLength": 8,
			"required": true
		},
		"tabindex": "",
		"properties": {
			"": ""
		},
		"conditional": {
			"eq": "",
			"when": null,
			"show": ""
		},
		"tags": [],
		"source": "xxx",
		"lockKey": true,
		"type": "password",
		"clearOnHide": true,
		"hidden": false,
		"persistent": true,
		"protected": true,
		"suffix": "",
		"prefix": "",
		"placeholder": "Enter password...",
		"key": "password",
		"label": "Password",
		"inputType": "password",
		"tableView": false,
		"input": true
	}, {
		"lockKey": true,
		"properties": {
			"": ""
		},
		"conditional": {
			"eq": "",
			"when": "",
			"show": ""
		},
		"tags": [],
		"type": "button",
		"theme": "primary",
		"disableOnInvalid": true,
		"action": "submit",
		"block": false,
		"rightIcon": "",
		"leftIcon": "",
		"size": "md",
		"key": "submit",
		"tableView": false,
		"label": "Submit",
		"input": true
	}],
	"owner": "xxx",
	"submissionAccess": [{
		"type": "create_all",
		"roles": []
	}, {
		"type": "read_all",
		"roles": []
	}, {
		"type": "update_all",
		"roles": []
	}, {
		"type": "delete_all",
		"roles": []
	}, {
		"type": "create_own",
		"roles": []
	}, {
		"type": "read_own",
		"roles": []
	}, {
		"type": "update_own",
		"roles": []
	}, {
		"type": "delete_own",
		"roles": []
	}, {
		"type": "team_read",
		"roles": []
	}, {
		"type": "team_write",
		"roles": []
	}, {
		"type": "team_admin",
		"roles": []
	}],
	"access": [{
		"type": "create_all",
		"roles": []
	}, {
		"type": "read_all",
		"roles": ["xxx", "xxx", "xxx"]
	}, {
		"type": "update_all",
		"roles": []
	}, {
		"type": "delete_all",
		"roles": []
	}, {
		"type": "create_own",
		"roles": []
	}, {
		"type": "read_own",
		"roles": []
	}, {
		"type": "update_own",
		"roles": []
	}, {
		"type": "delete_own",
		"roles": []
	}, {
		"type": "team_read",
		"roles": []
	}, {
		"type": "team_write",
		"roles": []
	}, {
		"type": "team_admin",
		"roles": []
	}],
	"tags": [],
	"type": "form"
}
` ``

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (9 by maintainers)

Most upvoted comments

That does help… We will take a look.

Hi @travist, we saw this issue after upgrading to the latest version. With the following versions, we don’t see this issue. “angular-formio”: “1.6.4”, “formiojs”: “2.24.5”

Are you planning to schedule this issue in the next release?