Question
PHP Preview form before submitting or printing
Students in one of my classes are completing their homework
online and submitting it to a MySQL database. So far, it works
well. But they can't preview their work before submitting it, and
if they try to print from the form, the printed font is extremely
small.
The solution seems to be a preview button that would bring up a separate form with the questions and their answers neatly formatted and reading for printing. There could either be a submit button on the second form that would submit the form to the database, or students could close the second form and submit the first one. I'd like to write a generic script that I can just require_once in the header of any homework assignment page.
I've looked at previous posts in this forum dealing with this question, and I've also searched for information on websites and in PHP forums. I find a few details, but not enough to help. For example, I find that I can use hidden fields or session variables to transfer the values of the various fields from one form to another; but the syntax is a little hazy. I'm also not sure how to transfer the fixed text I place on the page; that is, the homework problems themselves. To clarify my question, here is what a page might look like:
Assignment 3
Question 1. Go to [web link] and look [this] up. Summarize your findings.
[Textarea1]
Question 2. Take this information and compare it with what you read [here]. What discrepancies do you find, and how do you account for them?
[Textarea2]
[And so on through several questions.]
If I'm writing a generic script to include in the header of each assignment page, I'm not sure how to capture the text of each homework question and transfer it to the preview page, and I'm also not sure of what syntax to use to transfer the contents of each textarea.
Many thanks in advance for your help.
Joe Herl
The solution seems to be a preview button that would bring up a separate form with the questions and their answers neatly formatted and reading for printing. There could either be a submit button on the second form that would submit the form to the database, or students could close the second form and submit the first one. I'd like to write a generic script that I can just require_once in the header of any homework assignment page.
I've looked at previous posts in this forum dealing with this question, and I've also searched for information on websites and in PHP forums. I find a few details, but not enough to help. For example, I find that I can use hidden fields or session variables to transfer the values of the various fields from one form to another; but the syntax is a little hazy. I'm also not sure how to transfer the fixed text I place on the page; that is, the homework problems themselves. To clarify my question, here is what a page might look like:
Assignment 3
Question 1. Go to [web link] and look [this] up. Summarize your findings.
[Textarea1]
Question 2. Take this information and compare it with what you read [here]. What discrepancies do you find, and how do you account for them?
[Textarea2]
[And so on through several questions.]
If I'm writing a generic script to include in the header of each assignment page, I'm not sure how to capture the text of each homework question and transfer it to the preview page, and I'm also not sure of what syntax to use to transfer the contents of each textarea.
Many thanks in advance for your help.
Joe Herl