Home › Forums › Autocomplete › Autocomplete not saving new values
- This topic has 7 replies, 2 voices, and was last updated 8 years, 1 month ago by Alexander Bautz.
-
AuthorPosts
-
-
October 26, 2016 at 15:58 #13798
I cannot get Autocomplete to allow saving new values in DFFS NewForm. Clicking on “Add {0} to the address list?” saves a blank value for the AC field. Is there something I’m missing in the configuration? Here’s what is in the Custom JS:
spjs.ac.text = {
“imgTitle”:”The list of previously used addresses is updated automatically when you type”,
“noItems”:”No addresses match your search”,
“addNewItem”:”Add {0} to the address list?”,
“noValidItems”:”No valid items match your search”,
“invalid”:”Invalid value”,
“moreItemsLabel”:”Showing the first {0} items”,
“moreItemsMouseover”:”Continue typing to narrow your search”,
“searching”:”Searching for: ”
};spjs.ac.textField({
“applyTo”:”InspectionAddress”,
“helpText”:””,
“listGuid”:”Inspections”,
“listBaseUrl”:”/sites/fire/Prevention”,
“showField”:”InspectionAddress”,
“enforceUniqueValues”:false, // New in v1.33
“rowLimit”:15,
“listOptionsOnFocus”:false,
“reValidateOnLoad”:false,
“allowAddNew”:true, // New in v1.4
“isLookupInSelf”:true, // New in v1.4
“setFields”:[
{
“fromFIN”:”InspectionAddress”,
“toFIN”:”InspectionAddress”,
“parseFunction”:””,
“skipIfEmpty”:true
}
]
});Thank you!
-
October 26, 2016 at 22:47 #13803
Hi,
The “setFields” section is used to set additional fields (pull more fields form the lookup list based on the match made in the “showField” and write them to the current item). If the “InspectionAddress” field is the only one you want to populate, leave the “setFields” empty like this:"setFields":[]
I’m not 100% sure this is the issue, so please post back your findings.
Best regards,
Alexander-
October 27, 2016 at 15:05 #13831
Still same behavior…it lets me choose the new value, but doesn’t save.
-
-
October 27, 2016 at 19:04 #13834
Could you bring up the developer console (hit F12 > Console) and see if there are any errors there when you try to save?
Also, ensure you don’t have any custom code or DFFS rules overriding the set value on save.
Could you attach a screenshot of how the field renders in the form?
Alexander
-
October 27, 2016 at 21:32 #13848
No errors, but the following message comes up in the Console:
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
File: NewForm.aspxNo custom code or DFFS rules affecting the Address field. Attached are screenshots from before and after clicking “Add {0} to the list?”, and when an invalid string is left in the field…
Attachments:
-
October 27, 2016 at 23:10 #13858
Hi,
I have found the bug that prevented the values from being saved. I’m embarrassed to say it was a silly mistake in the code – introduced in v1.4.You find the change log and a link to download the changed file here.
Just unzip the file and upload and replace the file in your “/SPJS/DFFS/plugins” folder.
Sorry for the inconvenience and thank you for the patience.
Best regards,
Alexander -
October 28, 2016 at 14:39 #13862
It works! Thank you so much for your fast and thorough response!!
Cheers,
Celeste -
October 31, 2016 at 22:40 #13888
Thanks for the feedback – I’m glad it worked out.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.