By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,780 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,780 IT Pros & Developers. It's quick & easy.

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

P: 8
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 ..

Expand|Select|Wrap|Line Numbers
  1.  
  2. document.write ("</table> <INPUT type=\"submit\" name=\"mysubmit\" value=\"Click!\"></body></head></html>")
  3.  
  4.  
i simply want to use a submit button here, where i can use the following code to implement a back.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <A HREF="javascript:javascript:history.go(-1)">Click here to go back to previous page</A>
  3.  
  4.  
can you do this ??
Jun 11 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
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 ]
Jun 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.