jamesb — 2002-12-18T12:37:33-05:00 — #1
OK, now I know I'm being stupid here, but I am used to using asp or php but this project requires having a locally served html page that has a form that when submitted will show all the information as text - and I'm not sure how to do it!
I could have a print button on the form itself but the problem I have is with textareas, I need to print the scrollable region, among hiding some things from the input page. So say I have a name text field and a comments textarea field and a submit button. I want it to go to another html page that just shows the name and comments as text.
featuredhost — 2002-12-18T14:49:31-05:00 — #2
the form data ... could be printed on the resultant page via a CGI program , as in www.worldwidemart.com ( Form Mail) ,
jamesb — 2002-12-18T15:10:12-05:00 — #3
Just like in asp I just needed to create variables that corrensponded to request.form("values") and write it.
featuredhost — 2002-12-18T16:05:21-05:00 — #4
HTML only provides the layout of the page . You need some dort of program to respond to the form's request I am sure .
jamesb — 2002-12-18T16:31:38-05:00 — #5
I got the function here: http://www.btinternet.com/~a_urquhart/request.html
All I am doing is getting the data from the form and displaying it on another page. I could probably do it in vbscript too but just going to go forward. Thanks!
dale_burrell — 2002-12-19T04:18:33-05:00 — #6
My solution (in the other thread ) would do what you want, because even though it is one page it views as 2 and will print as 2 as well.
Alternatively you could pop up a new window and then populate it with the form data.
spartan — 2002-12-19T05:38:50-05:00 — #7
I'm with Dale_burrel on this one.
it would really be easier to do it with one page. I understand that you want it to generate some kind of printable report from the form that the user has just filled in.
you can split the page in two and turn each half on and off whenever you wish so it looks like you have two completely seperate pages. This would really make it much easier for you to grab the data the user has captured and display it in whichever element in the hidden part of the page. then just switch to the report half when you are done and make everything you dont want to print invisible.
and like Dale says. you could have it acting exactly as if you have two completely seperate pages. no reason why you cant have the report half of the page looking exactly like it would look on a 'actual' seperate page.
jamesb — 2002-12-19T09:53:52-05:00 — #8
james34 — 2002-12-20T01:20:34-05:00 — #9
james34 — 2002-12-20T01:31:53-05:00 — #10
jamesb — 2002-12-20T10:50:28-05:00 — #11
I already am doing something similar to this, that's what I meant by getting the function above, but thanks for the links. Another possibly helpful thing for your second link is to add somthing like this before it displays:
textareafield = textareafield.replace(/\
so your line breaks appear....