I'm trying to create a visual questionare that works in a way that if a user clicks on a button, that button's data attribute is taken and filled in into the iframe's fields. However, if you try to manually add in any additional info or interact in any way with the iframe, it removes all the auto-filled info.
Also if you try to submit the info it says that the input fields are empty.
Kind of stuck here.
<html>
<a href="#" onclick="autofill(this)" data-filled-value="USA">United States of America</a>
</html>
<script>
function autofill(element)
{
$("#form-iframe").contents().find("#country-field").val(element.dataset.filledValue);
evt.preventDefault();
}
</script>