Skip to content

Dynamic message on fade away #9

@ybressler

Description

@ybressler

If you'd like your javascript to give a more specific message, you can use the following:

<script type="text/javascript">
  $("#gform").on("submit", function(e) {
    $('#gform *').fadeOut(1_000);

    // get all the inputs into a dictionary.
    var $inputs = $('#gform :input');

    // You need to know the id of the element you want to extract
    var values = {};
    $inputs.each(function() {
        values[this.name] = $(this).val();
    });
    console.log(values);
    $('#gform'). prepend('Thank you for your submission ' + values["entry.810989529"] +'.').fadeIn(500);
    });
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions