This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.
SmartForms can be inserted in SharePoint pages using K2 Form Viewer or K2 SmartForms Viewer, which inherits from the SharePoint Page Viewer web part. When the form is viewed on a mobile device, such as an iPad, the scroll bar is not available which makes the form unusable. To resolve this issue, you must enable page scrolling by adding a script to the SharePoint page hosting the K2 Form Viewer. Follow the steps detailed in the workaround below:
- As a SharePoint administrator edit the SharePoint page that contains the K2 Forms Viewer web part.
- In the ribbon choose Insert -> Embed Code.
- Paste the following code:
- The sample script below shows the configuration for an iPad. Customize the script if you are using a different mobile device.
- The widths and heights in the script can be adjusted to ensure the form displays correctly on the targeted devices.
var is_iPad = navigator.userAgent.match(/iPad/i) != null;
var iframe = document.getElementsByTagName("iframe");
iframe.height = "100%";
iframe.width = "100%";
iframe.style.cssText = "display:block;";
iframe.parentElement.style.cssText = "height: 450px; width: 750px; max-width: 750px; max-height: 450px; overflow: auto; -webkit-overflow-scrolling: touch;";
iframe.parentElement.parentElement.style.cssText = "height: 460px; width: 760px;";
- Click Insert.
- Save the page.