Getting 405 error on form redirect

I have two embed iframe forms on two different plasmic pages. The form system pass url params from one form to another.
Form1 redirects to Form2{userEmail}
I get a 405 error
I reload the page and it works perfectly…
What can I do to bypass this 405?

I tried setting up the URL parameters in my plasmic Page data.
I tried a sloppy hack js window.location.reload()
I must be missing something… I’m stuck

Screenshot 2023-07-21 at 7.58.31 PM.png

Screenshot 2023-07-21 at 8.15.14 PM.png

Hi, sorry I don’t understand what is the situation and what is the issue. I tried inserting an iframe with that URL and it seems to work, so I’m guessing that’s not the issue.

Also, this describes how to create dynamic pages:

-Please add a test email to this form:
-Go to the end, click Submit
-You will be redirected to the next form with a 405 error. (look at url, you’ll se your ?userEmail)
-Refresh the page (it works)

What is wrong in my plasmic settings?

Sorry, I think I’m still confused - I just went directly to the jotform URL, submitted the form and still got 405. Is the question related to Plasmic?

Yes, because you got redirected to

the first form is loading fine. it’s the redirect that is not being accepted by plasmic it seems like

Right, how was this Next.js application created/setup/hosted?

by plasmic, no self hosting on this one

From Jotform I redirect to the following:

It seems to be working here like this:

You meed to submit the first form/contact

Hmm, why is the jotform then trying to POST to this URL?

I don’t know… Do you have time to do a share screen? or I can send you a screen recording

Sorry I don’t, but it should be something in the jotform settings - you aren’t going to be able to POST to a Next.js app like that unless you’ve defined your own API handlers in your own self hosted codebase

Why is it working when you reload then?


Because that’s sending a normal get request

      title="Website Questionnaire Form"
      allow="geolocation; microphone; camera"
    <script type="text/javascript">
    var ifr = document.getElementById("JotFormIFrame-231924387634160");
    if (ifr) {
      var src = ifr.src;
      var iframeParams = [];
      if (window.location.href && window.location.href.indexOf("?") > -1) {
        iframeParams = iframeParams.concat(window.location.href.substr(window.location.href.indexOf("?") + 1).split('&'));
      if (src && src.indexOf("?") > -1) {
        iframeParams = iframeParams.concat(src.substr(src.indexOf("?") + 1).split("&"));
        src = src.substr(0, src.indexOf("?"))
      ifr.src = src + "?" + iframeParams.join('&');
    window.handleIFrameMessage = function(e) {
      if (typeof === 'object') { return; }
      var args =":");
      if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); }
      if (!iframe) { return; }
      switch (args[0]) {
        case "scrollIntoView":
        case "setHeight":
 = args[1] + "px";
          if (!isNaN(args[1]) && parseInt( > parseInt(args[1])) {
   = args[1] + "px";
        case "collapseErrorPage":
          if (iframe.clientHeight > window.innerHeight) {
   = window.innerHeight + "px";
        case "reloadPage":
        case "loadScript":
          if( !window.isPermitted(e.origin, ['[](', '[](']) ) { break; }
          var src = args[1];
          if (args.length > 3) {
              src = args[1] + ':' + args[2];
          var script = document.createElement('script');
          script.src = src;
          script.type = 'text/javascript';
        case "exitFullscreen":
          if      (window.document.exitFullscreen)        window.document.exitFullscreen();
          else if (window.document.mozCancelFullScreen)   window.document.mozCancelFullScreen();
          else if (window.document.mozCancelFullscreen)   window.document.mozCancelFullScreen();
          else if (window.document.webkitExitFullscreen)  window.document.webkitExitFullscreen();
          else if (window.document.msExitFullscreen)      window.document.msExitFullscreen();
      var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false;
      if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) {
        var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)};
        iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*");
    window.isPermitted = function(originUrl, whitelisted_domains) {
      var url = document.createElement('a');
      url.href = originUrl;
      var hostname = url.hostname;
      var result = false;
      if( typeof hostname !== 'undefined' ) {
        whitelisted_domains.forEach(function(element) {
            if( hostname.slice((-1 * element.length - 1)) === '.'.concat(element) ||  hostname === element ) {
                result = true;
        return result;
    if (window.addEventListener) {
      window.addEventListener("message", handleIFrameMessage, false);
    } else if (window.attachEvent) {
      window.attachEvent("onmessage", handleIFrameMessage);

This is my iframe js