Sorry for this multiple posts, but still not able to update a field
Realized that Building field is blocked for Form Fillouts.
Now, Switching to COB_CustomData, It is still not working. I am clueless what is wrong here
API Name for COB_CustomData is cOBCustomData (lower c)
<script>
MktoForms2.whenReady(function(readyForm){
const formEl = readyForm.getFormElem()[0],
buttonEl = formEl.querySelector("#setCOBCustomData");
if(buttonEl){
buttonEl.addEventListener("click",function(e){
alert('before set value');
readyForm.setValues({
cOBCustomData: "your value"
});
alert('after set value');
});
}
});
</script>
COB_CustomData is NOT Blocked Updates From: None
But the Change Data value is not triggered in the Activity log
You need to be more attentive to case-sensitivity.
Please:
1. Fix the fatal error from the other script (due to another typo in a field name).
2. Change all alert() to console.log(). alert() is not the right troubleshooting tool for forms: it changes the form state (by moving focus) and is very distracting.
You can however see that the JSON data is posted with the form. Not sure what you’re trying to accomplish by posting all form values in this way, but they are being sent: