my dog learned polymorphism
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

Javascript and outline manipulation

Robin Rodgers

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?

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
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;

I agree. Here's the link:
subject: Javascript and outline manipulation
It's not a secret anymore!