Trigger function working in all browsers except chrome

Trigger function working in all browsers except chrome

Hello and thanks for the superb forum!!

Im using a script where you can add a postal code on a form which will be sent to an iframe. It works in all browsers exept for Google chrome.

This is the code im using:
  1. <?php if (isset($_POST['postcode']) && !empty($_POST['postcode'])) { ?>
  2. <script>
  3. $( document ).ready(function() {
  4.   $('#sd-iframe').load(function() {
  5.   $('#sd-root').trigger('setFieldValue', {
  6.     name: 'postcode',
  7.     value: '<?php echo htmlspecialchars($_POST['postcode']); ?>'
  8. });
  9.   });
  10.   });
  11. </script>
  12. <?php
  13.   }
  14. ?>
I have searched for solutions everywhere but didnt find. Hopefully my hero is here :)

Thnx Ralf