0

I have a list with a few people picker fields, i have a script on the new form:

function triggerPostback() {
       var saveButtonName = $('input[value$="Save"]').attr('name');
       WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(saveButtonName, "", true, "", "", false, true));
} 

function PreSaveItem() { 
    triggerPostback();
    return false;
}

Values in these people fields do not get saved when i press the save button. However editing the list item later and adding values does work.

Other non people picker fields do get saved.

0

Please try replace this:

var saveButtonName = $('input[value$="Save"]').attr('name');

to

var saveButtonName = $('input[value="Save"]').name;

I have tested in SharePoint 2013:

error when try get attr name from input

I do not understand what the problem is this, but i got error: Object doesn't support property or method 'attr'. wft??? Documentation in JQuery is correctly, click here for more details. Perhaps the Jquery that you called does not support.

But anyway, hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.