Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript and outline manipulation

 
Robin Rodgers
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic