« Return to Thread: drag & drop post to db
Re: drag & drop post to db
Sorry, first ever post to a group.
How do I get the following section of my javascript to post and return
a result:
$("#S1").click(function(e){$.post("scripts.cfm", { coords: e.pageX
+','+ e.pageY, strokeNo: '1', dropLocation: '?' });});
S1 is the draggable element (the id of the div, and there are 11 of
them, S2, S2 etc.) and becomes the srokeNo, how do I change this based
on the div object dropped?
the coords are working to the post section
Drop location is not working, I need to post the ID of the div where
the drag object was dropped.
I then need to return a calculated result, which I will do in
coldFusion from the scripts.cfm page, to the drag object div.
Thanks
On May 11, 11:43 pm, teazer <y...@...> wrote:
> After way too many hours wasted, I find I have to ask for help. I am a
> coldFusion programmer and a neophyte at jquery.
>
> I am trying to show and post info for a drag & drop page. I need to
> show the coordinates and strokeNo and post to a database the same plus
> the div of where the draggable was dropped. Hopefully this makes
> sense. Thanks in advance...
>
> test page:http://teazer.com/test.cfm
>
> $(document).ready(function(){
>
> $(".drag").draggable({containment: ".wrapper"});
>
> $(".drag").mousemove(
> function(e){$(this).html(e.pageX +','+ e.pageY);
> });
>
> $(".drop").droppable({
> accept: ".drag",
>
> drop: function(ev, ui) {
> var dragInfo =
> $(this).attr("id");
> $(this).append((ui.draggable).text());
> $(this).append(",");
> $(this).append(dragInfo);
>
> //posting the info to the database
> $("#S1").click(function(e){$.post("scripts.cfm", { coords: e.pageX
> +','+ e.pageY, strokeNo: '1', dropLocation: '?' });});
>
> }
> });
>
> });
« Return to Thread: drag & drop post to db
| Free Forum Powered by Nabble | Forum Help |