Page 1 of 1

Form with field, changed to titleRequired field Save with blank required field?

Posted: 28 Nov 2014
by Дмитрий Фоломеев
I use a function (titleRequired) to set field value requirement on the condition through javascript.

When the condition is true, and SharePoint header of field appears red * (e. m. title required).
Further, i leave the field (with title required) blank and click "Save" button on SharePoint form it save with no error.

Form with field, changed to titleRequired field Save with blank required field. The documentation also says that the only change the asterisk. How to make a filling fields (changed to titleRequired field) are required to save the form?

fd.field('_x041a__x043e__x043c__x043c__x04').titleRequired(true); //javascript code I use
..In addition. If the field was originally titleRequired sharepoint field and it change with javascript to titleRequired (When the condition is true), form is not saved, error output (the field is required).

Re: Form with field, changed to titleRequired field Save with blank required field?

Posted: 01 Dec 2014
by Dmitry Kozlov
Hi Dmitry,

You should validate the field via JavaScript in onsubmit handler:

Code: Select all

fd.onsubmit(function() {
	if (!fd.field('FieldName').value()) {
		alert('Please, fill-in the Field.');
		return false;
	}
	
	return true;
});