the needed params
if invalid params passed, or if title AND comments are not or empty string
if (JMap.Form.hasDisplayedForm() && JMap.Form.hasDisplayedFormAPhotoField()) {
const photos = getDisplayedFormPhotos()
if (photos.length > 0) {
JMap.Form.updateDisplayedFormPhoto({
photoId: photos[0].id,
title: "My new title !",
comment: "My new comment"
})
...
}
}
JMap.Form.updateDisplayedFormPhoto
Updates a photo to the currently displayed form.