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

rss

Posted by Дмитрий Фоломеев - Nov 28 ’14 at 09:58

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).

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 20 days
    #1 by Dmitry Kozlov Dec 1 ’14 at 09:49

    Hi Dmitry,

    You should validate the field via JavaScript in onsubmit handler:

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