jQuery: Post form to a modal window for previewing the entered data
- by superUntitled
I am looking for a way to use jQuery to allow a user to look at a modal window "preview" of a form before they submit the form to be saved.
I have this working with javascript, the form is posted to a file named preview.php that iterates through the posted information. The script currently opens a new window.
I would like instead to use jQuery to post the form to a modal window for previewing. Does anyone have any thoughts on how to do this?
This is what I am currently using:
<script language="JavaScript">
function preview(form) {
form.target='_blank';
form.action='http://example.com/preview.php';
form.submit();
}
</script>
<input type="button" value="preview" onclick='preview(this.form)'>