Ratufa Documentation

When there are more than one forms in the HTML page

Error: There are more than one forms in this page. You have to mention the ID of the form to attach to.

When there are multiple forms on the same page, provide an ID attribute to the form tag:

<form id="my_form_one" ...>
    ...
    ...
</form>

Now in the script tag to connect the form, provide the ID as a query parameter like this:

<script id="ratufa_loader" src="http://www.ratufa.io/c/ld.js?i=my_form_one&f=qzso9fih&n=localhost%3A3121"></script>

Notice the i=my_form_one parameter

When you want to connect the second form on the same page

You don't have to provide the script tag multiple times for each form. That will cause multiple requests and slow loading of the page.

Instead, for the second form, use code like this:

<script>
window.addEventListener("load", function() {
    window.RatufaContainer.loadForm({
        clientFormID: "my_second_form",
        ratufaFormID: "vh2z91q5",
        nodeDomain: "n1.ratufa.io"
    })
});
</script>