Automatically Edit or Save a Record

My email form development is progressing, but have a couple of issues I don’t know how to solve.

The unbound SendTo field is being properly updated when I select members in the Members page DataView. The SendTo text field successfully gets updated with the SelectedMembers, even though the form is not in edit mode. But I also need the user to be able to type in manual email addresses. to do this, I need to go into edit mode so the field is available to add text to. Since it is unbound, I can’t simply click in the field to enter edit mode. I must click the pencil icon.

So how do I put the form in edit mode via JavaScript code? Alternatively, is there a way to mark a particular field as editable even if the form itself is not yet in edit mode?

I probably don’t want to save the record, as all of the visible fields are unbound. There are 2 bound fields, DefaultSubject and DefaultBody, but they are hidden. At form-show time, their values are loaded into the Subject and Body unbound fields and are available for editing before the email is sent.

But if I must put the form in edit mode in order to add text to the SendTo field, I would probably want to cancel the edit as part of the code that runs when I click the GenerateEmails action button. How is this done via code?

Thanks…

Hi Ron,

We don’t have an exposed function that turns the Form into Edit mode.

One possible solution is to use a query selector to target a specific element in the DOM (HTML) and click on the button. (You can search for a few ways on how to achieve it)

Note: This approach may not work, depending on how the form is called and expecting it to be in edit mode. (This is a side-effect of React/behaviour in React, as you are trying to simulate the user click).

Regards,
Elton S