Using Elementor to insert custom HTML code. But it's not working. Many HTML elements are not rendered on the page at all. They seem to dissappear.
As you can see the <form>
<input>
and <script>
tags are ignored
Inserted HTML:
<form name="landingForm" onsubmit="createObject(); return false">
<label for="your_name">För- och efternamn</label>
<input type="text" id="your_name" required=""><br>
<label for="your_email">E-post</label>
<input type="email" id="your_email" required=""><br>
<label for="your_tel">Telefon</label>
<input type="text" id="your_tel" required=""><br>
<label for="your_job">Jobb-titel</label>
<input type="text" id="your_job" required=""><br>
<label for="your_account">Företag</label>
<input type="text" id="your_account" required=""><br>
<label for="agree"> Jag godkänner att mina uppgifter lagras av Chessit</label>
<input type="checkbox" id="agree" name="agree" value="agree" required=""><br>
<input type="submit" id="btnSubmit" value="Registrera">
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://webtracking-v01.bpmonline.com/JS/track-cookies.js"></script>
<script src="https://webtracking-v01.bpmonline.com/JS/create-object.js"></script>
<script>
var config = {
fields: {
"Contact": "#your_name", // Name of a contact, registering to the event
"Contact.MobilePhone": "#your_tel", // Contact's mobile phone
"Contact.JobTitle": "#your_job", // Contact's job title
"Contact.Email": "#your_email", // Contact's email
"Contact.Account": "#your_account"
},
contactFields: {
"FullName": "#your_name", // Name of a contact
"Phone": "#your_tel", // Contact's mobile phone
"Email": "#your_email", // Contact's email
"Account": "#your_account"
},
customFields: {},
landingId: "a52586c3-numbers",
serviceUrl: "https://aUrl.com",
redirectUrl: ""
};
function createObject() {
landing.createObjectFromLanding(config);
}
function initLanding() {
landing.initLanding(config)
}
jQuery(document).ready(initLanding)
</script>
Rendered HTML
<div >
<label for="your_name">För- och efternamn</label>
<br>
<label for="your_email">E-post</label>
<br>
<label for="your_tel">Telefon</label>
<br>
<label for="your_job">Jobb-titel</label>
<br>
<label for="your_account">Företag</label>
<br>
<label for="agree"> Jag godkänner att mina uppgifter lagras av Chessit</label>
<br>
var config = {
fields: {
"Contact": "#your_name", // Name of a contact, registering to the event
"Contact.MobilePhone": "#your_tel", // Contact's mobile phone
"Contact.JobTitle": "#your_job", // Contact's job title
"Contact.Email": "#your_email", // Contact's email
"Contact.Account": "#your_account"
},
contactFields: {
"FullName": "#your_name", // Name of a contact
"Phone": "#your_tel", // Contact's mobile phone
"Email": "#your_email", // Contact's email
"Account": "#your_account"
},
customFields: {},
landingId: "a52586c3-numbers",
serviceUrl: "https://aUrl.com",
redirectUrl: ""
};
function createObject() {
landing.createObjectFromLanding(config);
}
function initLanding() {
landing.initLanding(config)
}
jQuery(document).ready(initLanding)
</div>
Why aren't my script tags rendered? It's so strange. Is Elementor supposed to honor my custom html or is it forcing me to use WordPress-form or something else other than basic HTML form?
CodePudding user response:
you have to use html widgets for custom html so your whole code was rendered with form, js
CodePudding user response:
https://prnt.sc/o_vQFGlgNLrh check this images in my side its works