Hello Everyone,
In one of my web form steps I am trying to prepopulate a Lookup field using Jquery and using a code like below:-
//retrieve values from hidden fields
var evename=document.getElementById("hdneventname").value;
var evenid=document.getElementById("hdneventid").value;
//find the iframe loading the modal form
$("iframe").contents().find("#new_event").val(evenid);
$("iframe").contents().find("#new_event_name").val(evename);
$("iframe").contents().find("#new_event_entityname").val("new_event");
This I coded last month and It was working fine but for no reason it started breaking and client has come back with a bug. This script is added from CRM Portals by Going to Web form step->Edit->Options area. Error message in browser console as in below:

Can someone suggest what could be the reason? The modal is opening on a button click and I have binded an event to populate a field which is present on the modal being loaded. The form having the button and modal both are on same portals and using https.
Thanks In Advance