• Resolved ropelletier

    (@ropelletier)


    I have several dynamic fields populated by a shortcode. If the field is edited and submitted the field reverts back to the original value.

    These values are pulled from a mysql table. Upon submission those values are updated from the values of the submission in the table.

    If I refresh the page, the fields will then show to correctly edited values, but this should of course happen after submission as well.

    Please let me know what I may be doing wrong. Thank you.

    Here is my form:

    <div class="grid grid-pad">
        <div class="col-1-2">
           <div class="content">
               <label> Cell (Voice)
                    </label>[dynamic_tel cell "alert_information attribute='cell'"]
           </div>
        </div>
        <div class="col-1-2">
           <div class="content">
               <label> Cell (Text)
                   </label> [dynamic_tel text "alert_information attribute='text'"]
           </div>
        </div>
    </div>
    
    <div class="grid grid-pad">
        <div class="col-1-2">
           <div class="content">
               <label> Landline (Voice)
                    </label>[dynamic_tel land "alert_information attribute='land'"]
           </div>
        </div>
        <div class="col-1-2">
           <div class="content">
               <label> Email 
                   </label> [dynamic_email email "alert_information attribute='email'"]
           </div>
        </div>
    </div>
    
    <div class="grid grid-pad">
        <div class="col-1-1">
           <div class="content">
               [submit "Send"]
           </div>
        </div>
    </div>
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    The form tags look right to me. I first want to make sure I understand the problem.

    1. Page is loaded, values from mysql table prefill the fields using the [alert_information attribute="X"] shortcode—working!
    2. User changes data, submits form, values in mysql table are updated—working!
    3. [something happens??] user sees old data—no no!
    4. If page is refreshed, on page load, the updated data is properly pulled from the mysql table—working!

    Can you explain more about what you mean “If the field is edited and submitted the field reverts back to the original value.” and “but this should of course happen after submission as well.” please?

    By default, CF7 submits the form and clears out the values, so I’m wondering if you added JavaScript to put those values back in and maybe they grabbed the old ones.

    Thread Starter ropelletier

    (@ropelletier)

    Yes, you understand the issue completely.

    Can you explain more about what you mean “If the field is edited and submitted the field reverts back to the original value.” and “but this should of course happen after submission as well.” please? For example, if the “cell” input originally has the value 555.555.1555 and I change it to 555.111.1555 and then submit it; the value in the input returns to 555.555.1555 giving the user the false impression that the change did not occur. However, if you refresh the page, the input will populate with the changed/correct value 555.111.1555.

    When I say this should happen after submission as well; I mean that the changed value should remain after submission without having to refresh.

    I do not have any javascript running for this process. When submitting a form that is NOT pre-populated dynamically, the values do dissappear after submission.

    Thank you for your help.

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    Sorry for the long delay! Is this issue on a publicly available URL for me to look at? The part that has me confused is that after submission, you see anything still in the fields at all.

    On a brand new WordPress install with only CF7 and DTX installed, submitting the form automatically clears the fields. The fact that it doesn’t means something else is interrupting the flow and adding data back in. I want to look to see what JS is loading on the page to figure out what script (or plugin) is responsible, and if it’s possible to edit it to pull the new values rather than the old ones.

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    Marking this as closed due to inactivity. Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Values in dynamic field revert to original value after submission’ is closed to new replies.