Jotform popup to open from menu

  • 1
  • Question
  • Updated 1 year ago
  • Answered
  • (Edited)
I have a form built in jotform which provides some script:

<a href="javascript:void( window.open( 'https://form.jotform.com/72853972112155', 'blank', 'scrollbars=yes, toolbar=no, width=700, height=500' ) ) "> Showing </a>

I will like to execute the script when this menu item is selected.  The script opens a popup form.
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb

Posted 1 year ago

  • 1
Photo of John Dahlberg

John Dahlberg, Champion

  • 2,442 Points 2k badge 2x thumb
This script is simply opening the url referenced.  You can just have the menu item open a declarative popup and in the popup use a template with HTML for an iframe containing this page.  This should get you pretty close:

<iframe src="https://form.jotform.com/72853972112155" width="100%" height="500px" frameBorder="0" scrolling="no" />

Note that you set the width of the popup declaratively.
Photo of John Dahlberg

John Dahlberg, Champion

  • 2,442 Points 2k badge 2x thumb
If you want to get fancy, here's a snippet (i.e. "dynamicPopup") you can use to build popups dynamically.  This is an agnostic script that allows you to pass in parameters from your url, which is handy for links where the action framework isn't available (like in a rich text URL reference) or you need more flexibility with your snippet.  I use this to load other skuid pages, but you could adjust this for your needs.  A quick solution being to set up a dedicated skuid page for your form that you can reference from other spots.

var pageInclude = arguments[0];
var Id = arguments[1];
var Title = arguments[2];
var Width = arguments[3];
var popupXMLString = 
'<popup title="'+Title+'" width="'+Width+'%">'
+ '<components>'
+'<includepanel type="skuid" uniqueid="" pagename="'+pageInclude+'" module="" querystring="Id='+Id+'"/>'
+'</components>'
+'</popup>';
var popupXML = skuid.utils.makeXMLDoc(popupXMLString);
popup = skuid.utils.createPopupFromPopupXML(popupXML);


In your HREF, you would use the following syntax:

javascript:skuid.snippet.getSnippet('dynamicPopup')('PagetoInclude','Id if you have one to pass in','Title of the Popup',50);

As an additional (Important) detail, using this technique for navigation is pretty powerful, because as of the current release, you can't pass in declarative parameters with the run snippet action.  This approach provides a lot more flexibility and improves code reuse.
(Edited)
Photo of Bill Fox

Bill Fox

  • 7,954 Points 5k badge 2x thumb
Hello John,   I have added an additional menu item with action  of popup. It does open as a popup but is stuck inside the page include.  https://drive.google.com/file/d/0BzBJWINUVfkvWDVKZEZlYVhyeFk/view