Gravityform "change" event

Please can anyone help me with this code:

// Wait for the document to be fully loaded
$(document).ready(function () {
  // Target the input field you want to trigger the "change" event on
  var $inputField = $('#input_3_5');

  // Get the original value
  var originalValue = $inputField.val();

  // Function to auto-populate the input field
  function autoPopulate() {
    // Simulate auto-population from another source
    var newValue = 'New Value'; // Replace with your actual auto-populated value

    // Update the input field with the new value
    $inputField.val(newValue);

    // Check if the value has changed
    if (originalValue !== newValue) {
      // Trigger the "change" event
      $inputField.trigger('change');
    }
  }

  // Call the auto-populate function
  autoPopulate();
});

Hey Frank,

Could you please provide more details about what you would like to accomplish, so that either I or someone else can help you resolve the issue? :smile:

Thank you Faisal,

What i accocomplish a “change event” on gravityform field.

I have two form on my website. form 1 is on page 1 and form 2 is on page 2, so i Pass Field Data via Query String from form 1 to form 2. so i want use jQuery to trigger “change event” to form 2.

Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.