wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript and outline manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript and outline manipulation" Watch "Javascript and outline manipulation" New topic
Author

Javascript and outline manipulation

Robin Rodgers
Greenhorn

Joined: Aug 04, 2005
Posts: 3
Hi. I am relatively new to javascript and am thinking about trying to use it on part of my program. I want to allow users to edit an outline - add, edit, insert, delete, reorder, etc. outline items. On my first try at adding an item, I noticed that when I 'view source', the added row does not show up. First, I'd like to know if this is a practical idea or if I should just re-retrieve the page on edits. Secondly, if I go this route, would I be able to get the completed outline to the back end to save to the database? Currently I have ordered lists (for the formatting - indents, etc.) with embedded paragraphs for the text (so 'select' will select a single row and not an embedded list) - any better ideas?

Thanks!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
when you view the source you see the document from the server not the one with the changes since the changes are made in 'memory'. If you do this manipulation with JavaScript you are going to have to track the changes somehow. A lot of people use a hidden field.

You also can see the changes by looking at the source of the body

yourHTML = document.body.innerHTML;

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Javascript and outline manipulation