Does KoboToolbox support postMessage for Height?

Hello,

I’m trying to solve a cross-origin issue as my form is displayed on a WORDPRESS-site via an iFrame. The site and the KoboToolbox-form being on 2 different servers, comes up this question :

Does KoboToolbox support postMessage ? / Where can I figure out if KoboToolbox’s iFrames send height data via postMessage ?

This would help me figuring out how to solve an Height-issue.

Best regards,

:slightly_smiling_face:

Hello @alienationfreez, from my undertsanding KoboToolbox forms in an iFrame do not send postMessage events to adjust the height automatically. That’s why you are seeing a height problem. The easiest way to fix it is to set a fixed height for your iFrame using CSS. Example:

<iframe src="YOUR_KOBO_FORM_URL" style="width: 100%; height: 1200px; border: none;"></iframe>

You can adjust the height value depending on how long your form is.

1 Like

Thanks for your feedback, Brian !

Setting a fixed height for my iFrame remains tricky, as the form is going to be huge ( long ). Users are supposed able to add new answer-blocks, so it’s hard to say how long the form will become at the end – as it depends on individual choices. If possible, it would be great to have it dynamically grow the site height. I’m not sure what’s the most elegant way to achieve it. What do you think ?

Kind regards

:slight_smile:

Hello @brian_achaye

I started a thread focusing on the issue ( Clarification on X-Frame-Options Impacting Iframe Height Calculation in WordPress Integration ) … but it doesn’t seem quite easy to fix.

Any hint or step-by-step advice would be much appreciated :slight_smile:

Kind regards