function submit_preview() { document.getElementById("cardform").submit(); } window.setTimeout(submit_preview, 1);