Jump to content

Rather foolish question...


Ixa Arkanil

Recommended Posts

Erm... 'ello... :)My intent is simply to add text to a document using javascript.It should be easy, yes? Well... it's liable to be, but I'm stuck; I cannot seem to manage this without replacing all text IN the document. >_<;Thusly, the input of a form is stored as a string, I attempt to write that string to a document, and the document goes away. OR the page just goes blank.I apologize, but I've literally spent months on this project, on and off, but this always becomes a block. It's the last element I need to nail down before I can make decent progress, AFTER which I'll likely be submitting examples left and right. I've no formal training in programming, and have only been able to learn through W3's various tutorials and attempting to dissect other pieces of code. Arrays to the untrained eye are scary. :) ...anyway... thank you for your attention, and... I'm going to go through the tutorial start to finish for the fifth time. >_<;Edit: This is as close as I've come... archive.htm is the document to be written to.

<html><head><script type="text/javascript">function postinfo(){info=document.forms[0].reaction.valuedocument.write(archive.htm) anddocument.write(info)}</script></head><body> <BODY bgcolor="BLACK" Font Color = "white"><form onsubmit = "postreaction()"  <table cellspacing="6" cellpadding="9" bgcolor="#000000" align="center">   <tr>    <td valign="top"><font color="white">Add:</font></td>    <td><input type="text"  textarea wrap input id="reaction" cols="36" rows="9"></textarea></td>   </tr>   <tr>    <td valign="top" align="center" colspan="2">    <input type="submit" value="Submit">    </td></body>

Link to comment
Share on other sites

No question is foolish here. :)One way you could do it is make a table with an id. Then, in the function, add this:document.getElementById("table id here").innerHTML=archive.htmdocument.getElementById("table id here").innerHTML+=info

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...