I have a webpage which the user can drag a marker around inside a div and the script then shows the standard js alert box with the final positions of the marker once the user has stopped dragging it about. What I need to do is get the script to add these values to two hidden input elements in the page. Can anyone tell me how I can do this please?
The script I'm using is below, any help with this would be greatly appreciated.
Code JavaScript:$( init ); function init() { $('#makeMeDraggable').draggable( { cursor: 'move', containment: 'content', stop: handleDragStop } ); } function handleDragStop( event, ui ) { var offsetXPos = parseInt( ui.position.left ); var offsetYPos = parseInt( ui.position.top ); alert( "Drag stopped!\n\nOffset: (" + offsetXPos + ", " + offsetYPos + ")\n"); }
Thanks in advance.



Reply With Quote




Bookmarks