Write a document to a page and submit using a button (and implement back button)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • localp
    New Member
    • Jun 2008
    • 8

    #1

    Write a document to a page and submit using a button (and implement back button)

    the code found below is in a javascript file. what i am trying to do is to write a document to a page and submit it ( or to inplement a back ) .. for this i want to create a button .. when i wrote the following code nothing happend .. can your'll look in to this and let me know ..

    Code:
    document.write ("</table> <INPUT type=\"submit\" name=\"mysubmit\" value=\"Click!\"></body></head></html>")
    i simply want to use a submit button here, where i can use the following code to implement a back.

    Code:
    <A HREF="javascript:javascript:history.go(-1)">Click here to go back to previous page</A>
    can you do this ??
    Last edited by acoder; Jun 12 '08, 08:25 AM. Reason: fixed code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Your HTML is incorrect in the document.write statement. You have a head closing tag after the body tag.

    If you want a back button on the page, use a button and put the history.go in an onclick. You don't need a back button though - it's already provided!

    PS. thanks for using code tags. Unfortunately, you used the wrong type. They're the square bracket type: [code ]

    Comment

    Working...