I am trying to input an external contact form from a Property Management system. However it won’t work in an iFrame.
Here is the code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rentmanager.com/js/GuestCardForm.js" ></script>
<link rel="stylesheet" type="text/css" href="https://cdn.rentmanager.com/css/GuestCardForm.css">
<div id="#guestCard1" >
<div class="guestCardFieldsUAContainer">
<!-- The form fields will be generated here -->
</div>
</div>
</div>
<script>
$(document).ready(function () {
var rmGuestCardOptions = {
DBID: "leanos",
Location: "Default",
TemplateName: "LP GUEST CARD",
DefaultProperty: "RHMHP",
}
$('.guestCardFieldsUAContainer').GuestCardForm("initialize", guestCardOptions); /* This initializes the form. You can set this on any container on the page */
});
</script>
It won’t work in an iFrame because the iFrame is preventing the code from calling the property management system. What should I do to get the form to show up?
This is what the form should look like
Here is the instructions that were provided to me to set it up
You need to create an HTML form inside your div container.
https://www.w3schools.com/html/html_forms.asp
Your instructions also recommend to include a use of the Google reCAPTCHA API.
https://girizano.wixsite.com/codecorner/post/google-recaptcha
Adding on to Brainstorms excellent reply.
You can also look at the Wix Support pages for HTML Component as that will tell you how to pass data from page to html and back again.
https://support.wix.com/en/article/corvid-working-with-the-html-element
https://www.wix.com/corvid/reference/$w.HtmlComponent.html
Although please note that Wix don’t provide support for code provided by third party providers as they have not had the chance to fully test it all works themselves.
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
***We cannot provide support for external codes that were not created or tested with Wix. If you are experiencing an issue with your code snippet, please contact the provider directly. ***
Therefore you are much better suited going back to the third party provider, in this case Rent Manager and asking their own support how to integrate it into Wix.
However, looking at Rent Manager they do their own API, so you would be much better and securer using that method instead of using html code.
https://www.rentmanager.com/products/features/enhancements/api/
You could use them with Wix Fetch or Wix HTTP Functions.
https://www.wix.com/corvid/reference/wix-fetch.html
https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
https://www.wix.com/corvid/reference/wix-http-functions.html
https://support.wix.com/en/article/corvid-exposing-a-site-api-with-http-functions
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-myapi-and-myapiclient