You are viewing limited content. For full access, please sign in.

Question

Question

Jquery Error: Blocked a frame with origin from accessing a cross-origin frame

asked on August 2, 2017 Show version history

For one of our customers, we had an external web form passing some values to variables in Laserfiche Forms using the variable class name.

The code used on the web page to insert the values to the form is ....

$(document).ready(function () {
            var $iframe = $('#object6');

            $iframe.load(function () {
                $firstname = $('#hf_first_name').val();
                $surname = $('#hf_surname').val();
                $ein = $('#hf_ein').val();
                $email = $('#hf_email').val();
                $homeLocation = $('#hf_home_location').val();
                $groupCode = $('#hf_group_code').val();
                //alert($iframe.val());

                $iframe.contents().find('.FirstName input').val($firstname);
                $iframe.contents().find('.LastName input').val($surname);
                $iframe.contents().find('.EIN input').val($ein);
                $iframe.contents().find('.EmployeeEmail input').val($email);
                $iframe.contents().find('.HomeLocation input').val($homeLocation);
                $iframe.contents().find('.PrimaryGroup input').val($groupCode);
        });
});

 

Field values on the LF forms each have a class name assigned, and the javascript above is inserting the values into the class names (ie .FirstName input, .LastName input, .EIN input, etc.).
 

This function had worked with 9.1 without any issues.  We recently upgraded the Laserfiche servers (server, Forms, Workflow) to 10.2.1 with the latest hotfixes.  After this upgrade, the external web  is not passing the values to Laserfiche Forms.  Attached is the error from web debug screen.

Any ideas??

 

Thanks for you help in advance.

 

AJ 

 

0 0

Replies

replied on August 3, 2017

Hi Aj,

Your error is expected if your page and Forms are using different domains. For the same-origin policy browsers block scripts trying to access a frame with a different origin.

For workaround, you may reference https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame

0 0
replied on August 14, 2018

Do you have any control over the 'external' page? I developed a SQL & HTML based calendar in an iframe for a showroom booking form which lead me upon this error and managed to avoid it by placing the source pages of the calendar inside the Forms directory in Program files.

 

Basically most browsers will block any effort to influence the parent page from the frame-source when it is not in the same locality.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.