How to save object positions?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jake Garland

    How to save object positions?

    Ok, so I'm using javascript to allow users to move image objects around my web-page, I have built my own usersystem for it, basically a little like piczo.

    How do I get the object positions (after I've moved them) to save when I click the "save" button?

    Need it to save into a database...
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    You need to have a hidden form to work with. Whenever something is moved, update the values in the form. For example, for every item that can be positioned, you need an <input> element to store the X position and an <input> element to store the Y position. Then, when they are done, submit the form and you'll have those values.

    This is the way many dynamic elements are accomplished on the web. We use advanced items to represent basic items.

    Comment

    Working...