js-exform/public/parent.html

39 lines
959 B
HTML

<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
const data = {
type: 'iframe',
title: 'Contact Form',
items: [{
type: 'text',
title: 'Name'
}, {
type: 'text',
title: 'Email'
}, {
type: 'text',
title: 'Phone'
}, {
type: 'radio',
title: 'Test',
optTexts: ['Option 1', 'Option 2', 'Option 3'],
optValues: ['Option 1', 'Option 2', 'Option 3']
}]
};
window.onload = () => {
const iframe = document.getElementById('iframe');
iframe.contentWindow.postMessage(data, window.origin);
};
</script>
</head>
<body>
<iframe
src="/index.html"
style="width: 100%; height: 100vh; border: none;"
id="iframe"></iframe>
</body>
</html>