I have a form. If a patient has not entered any allergies into the $w( ‘#allergies’ ).value field on clicking the Submit button, I want the $w( ‘#allergies’ ).value in the collection to update to “Sin alergias conocidas”
@jonatandor35 Thanx… Still learning about beforeInsert. I have many fields that need to be added to the collection as the record is saved. But when I use the “If” statement to update the one particular field… it doesn’t get saved with the rest of the data.
@jonatandor35 Got it working.
I setFieldValues to update that one field $w( ‘#allergies’ ).value called “allergies” with “Sin alergias conocidas”
ie. “allergies” : “Sin alergias conocidas”