Infopath cannot update the data because the form is currently read

S

Shanker24

I am trying to update a control using the below code.
function msoxd_my_DOB::OnValidate(eventObj)
{
// Write your code here
XDocument.DOM.selectSingleNode("/my:myFields/my:Anniversary").text =
"2001-01-01";
}

But i am getting this error.

Infopath cannot update the data because the form is currently read-only.
 
E

em

hi,
you should use OnAfterChange-event, because OnBeforeChange- or
OnValidate-events place the form's underlying XML document in read-only mode.
regards
em
 
Top