Jump to content

Passing parameter from page into iframed form?


Recommended Posts

Hello,

 

Prior to the latest updates to CASPIO, the code I have below worked to pass the date of an event into the form I have iFramed into the page.

 

<script type="text/javascript">
var eventday = "Wednesday";
var eventdate = "January 17, 2017";
var rsvpby = "Tuesday, January 16, 201";
document.getElementById('eventDayDate').innerHTML = eventday + ", " + eventdate;
document.getElementById('rsvpby_date').innerHTML = rsvpby;
document.getElementById('InsertRecordworkshop_date').value = eventdate;

</script>

Once the form was submitted the form field "workshop_date" captured the var 'eventdate' info, and sent it to me in the subject line and body of every RSVP.

Doesn't work now..  so how do I get the event variable date to pass into the iframed form on page load now?

Thanks,

Geoff

Link to comment
Share on other sites

Hi geoffdude,

I know that onload event in no longer supported in Caspio after 10.0 release because of restriction applied by new deployment method. 

https://howto.caspio.com/release-notes/caspio-bridge-10-0/

A workaround solution described at the bottom of this article:

https://howto.caspio.com/deployment/

Regards,

vitalikssssss

Link to comment
Share on other sites

Thanks, but my javascript code is not part of the CASPIO form, it's placed externally at the footer of my page.

When the page loaded, the script ran and placed the variable value of DATE into the iFramed Form Hidden Field. This no longer happens.. something broke.

So.. in summary I'm trying to figure out -> How To Pass an External Parameter (Var Value)  into an iFramed Form Field.

Regards,

Geoff

Link to comment
Share on other sites

Actually, my iFrame for the CASPIO form is NOT the same domain as my web-page.

My web page lives on another server, with another domain id.

My web page is for providing info and details for a Home Morg. event. The CASPIO form is to RSVP to that event -and is iFramed into that page... the web page (on another domain) is running the javascript to send the var parameter of DATE into the CASPIO form on page load. Except, now it's not since the CASPIO update 10.0.

Thanks for the link to the stackoverflow topic, but it didn't have any solutions for my specific issue.

*Still looking for a solution. :(

Best,

Geoff

Link to comment
Share on other sites

  • 4 years later...

Hi - To pass URL query string parameter to an iFrame, you may do the following:

1. Add an id attribute on your iFrame, like add id="myiframe". The deployment code should be like this:
<iframe name="Some iFrame" title="Some iFrame" src="https://c1234567.caspio.com/dp/xxxxxxxxxxxxxxxxxxx" id="myiframe" >Sorry, but your browser does not support frames. Please, contact us.</iframe>

2. Once the id is added, copy and paste the code below in your webpage:

<script language="javascript">
var iframe = document.getElementById('myiframe');
iframe.src = iframe.src + window.location.search;
</script>

You can change the name of the iframe id depending on your preference.

What that code/script does is get the parameter query string of the current page and add the same query string to the iframe src.

Hope it helps!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...