• Resolved graham6117

    (@graham6117)


    Hi, hopefully a simple one. I am looking for an example of how to build a custom “edit” form. The following works perfectly on my site:

    [msdyncrm_twig]
    {% form entity=”contact” name=”WordPress Example Form” mode=”edit” record=currentrecord %}{% endform %}
    [/msdyncrm_twig]

    But I need to customise it. I am using a custom “create” form elsewhere, but using similar code I am unable to get it to work in “edit” mode.

    [msdyncrm_twig]
    {% form entity=”contact” mode=”edit” record=currentrecord required=[“firstname”, “lastname”, “emailaddress1″] %}
    <form method=”POST”>
    <div class=”newsletter__form–field”>
    <label for=”firstname”>First name</label>
    <input name=”firstname” required=”” type=”text” />
    </div>
    {% endform %}
    [/msdyncrm_twig]

    If I try to access {{ record[‘firstname’].value }}, nothing happens.

    Has anyone got any example code for a simple edit form? Thamk you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author alexacrm

    (@alexacrm)

    Hi @graham6117

    firstly, does the form renders correctly with the existing values?

    Secondly. can you elaborate on

    If I try to access {{ record[‘firstname’].value }}, nothing happens.

    Trying to access where? On a bound page itself it should be {{ currentrecord.firstname }}.

    Thanks
    George

    Thread Starter graham6117

    (@graham6117)

    Ah, that what I was doing wrong! I appreciate the response.

    • This reply was modified 7 years, 3 months ago by graham6117.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom “edit” form’ is closed to new replies.