staticFormEmails icon indicating copy to clipboard operation
staticFormEmails copied to clipboard

Dynamic message on fade away

Open ybressler opened this issue 3 years ago • 0 comments

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>

ybressler avatar Apr 10 '22 23:04 ybressler