SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Display form data on html page

    I posted this in the html forum but thought here would be more appropriate.

    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.

    I guess I would be using client-side javascript or vbscript, getting the different field values and writing them on the page? Does anyone have any examples of this, or is there a better way? Thanks.

  2. #2
    SitePoint Guru dale_burrell's Avatar
    Join Date
    Aug 2002
    Location
    Wellington, New Zealand
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No sure if I understand the problem correctly... I'm not clear why you're trying to do that...

    But a possible solution might be something like this.

    Create a page, split it into 2 halves, the first being the initial form and the second being the form contents displayed however you want to display them.

    Put each half of the page in a table cell and set style.display = "none" on the second cell.

    Then when someone presses the submit button you can call a JavaScript function that will firstly transfer the contents of the form into whatever elements you chose for you second half layout, and secondly hide the first cell by setting style.display = "none" and show the second cell by setting style.display = "".

    Useful? Or Pissing in the wind?
    If you aren't living life on the edge
    - you're taking up too much space
    Creative Dreaming Ltd / Ask The Local / Amanzi Travel

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. To attempt to be more clear. I want two pages. One an input form and one a results page. If I were to use asp I would have a form that would action to another page that would get the form results and display them.

    I found a javascript function that gets querystring results: http://www.btinternet.com/~a_urquhart/request.html

    It seems to work nicely, although is going to be a bit of a pain since I have 70 form fields to display. The reason why I want two pages is because I don't want to print out form fields. It is supposed to look like a report.

    Thanks again.

  4. #4
    Bimbo With A Brain! silver trophy Saz's Avatar
    Join Date
    Mar 2001
    Location
    Kent, United Kingdom
    Posts
    5,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, but we don't allow duplicate thread in these forums. There's a chance that a member will only see the one thread and take time to answer you, only to find out that the answer has been given elsewhere.

    Please use the other thread to discuss this problem. Thanks.
    Saz: Naturally Blonde, Naturally Dizzy!
    No longer Editor of the Community Crier.

    Don't mind me, I'm having a BLONDE moment!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •