New Wizard Help

Hi Guys,

I like the look of the Wizard container and love the idea of being able to validate prior to moving on to the next section, but there is no information in the documentation about how to interact with the Next Buttons, Back Buttons or Finish Button. Could you provide some pointers, lets say for example I have a field Title on section 1 that I want to ensure is not blank before the user can move to Section 2, how would I implement this?

Thanks

Dear Tony,

The specificity of the Wizard container is that it forces a validation process before the user can open the next step.

Considering your example, you should add a validator to your Title field: https://plumsail.com/docs/forms/javascript/fields.html#properties (check “validators” properties)

Hi Alex,

Thank you for this, I have got all of the fields validating now except for one which is a Multiple select lookup field, I just can’t seem to get the context right for the validation to work… my current code is: -

fd.field('Company_x0020_Type').validators.push({
	name: 'MyCustomValidator',
	error: '',
	validate: function(value) {
		if (!value) {
			this.error = 'Company Type Must not be blank';
			return false;
		}
		return true;
	}
});

A little help appreciated.

Thanks

Dear Tony,

I’ve slightly changed your code, please take a look at it:

fd.field('Company_x0020_Type').validators.push({
	name: 'MyCustomValidator',
	error: '',
	validate: function(value) {
		if (value.length == 0) {
			this.error = 'Company Type Must not be blank';
			return false;
		}
		return true;
	}
});