- Create Account

Save co-ordinates into a database

Forums > DragResize > Save co-ordinates into a database
Author
Message

1) graham01 Group: Members
Posts: 8 Joined: 21 Feb 2008 Location: england IP: 90.202.--.--
Hello, is it possible to save the co-ordinates of the dragable items into a database?

I only really need 2 textbox's which display the vertical position of the top and bottom of the divs, and I can do the rest from that.

Thanks,
Graham.

2) Angus Turnbull Group: Moderators
Posts: 4235 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
It surely is. You will just have to do it yourself :). I would suggest building a small JavaScript that upon some "save" event checks the element positions and saves them AJAX style or however to a CGI script on your server. Should not be too difficult if you are familiar with the tech involved! You won't really have to make any modifications to this script.

The only real thing you might want to bear in mind is that the script exposes an "ondragend" event that is called when you release an element, that could come in handy if you want to save positions on the fly.

- Angus.

3) graham01 Group: Members
Posts: 8 Joined: 21 Feb 2008 Location: england IP: 78.86.--.--
by any chance could you please tell me how to call the new co-ordinates of the moved object using the ondragend function? I am new to javascript and don't have a clue where to start :(

Thanks,
Graham.

4) graham01 Group: Members
Posts: 8 Joined: 21 Feb 2008 Location: england IP: 78.86.--.--
thanks for the help anyway, i have this sorted now :)

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.