[scriptaculous] dragging and <input> field

B

Bart van Deenen

Hi all
I have a form with a couple of input fields, embedded within spans. I am
using script.aculo.us for dragging and dropping, and want to reorder the
input fields that way. The input fields are display:inline because I
want them all on the same line.

Does anyone know of a smart trick to be able to drag these input fields?
Just setting their disabled attribute doesn't work, because then they
get no events. Not setting disabled just causes the fields to show a
text cursor when you try to drag. I have a working solution with
absolutely positioned blocks on top of the inputs, that drag the fields
with them, but I find it quite ugly.

Anyone any better suggestions?

Thanks

Bart van Deenen
 
A

Aaron Gray

I have a form with a couple of input fields, embedded within spans. I am
using script.aculo.us for dragging and dropping, and want to reorder the
input fields that way. The input fields are display:inline because I
want them all on the same line.

Does anyone know of a smart trick to be able to drag these input fields?
Just setting their disabled attribute doesn't work, because then they
get no events. Not setting disabled just causes the fields to show a
text cursor when you try to drag. I have a working solution with
absolutely positioned blocks on top of the inputs, that drag the fields
with them, but I find it quite ugly.

Anyone any better suggestions?

You need to do for <span>'s what has been done for <div>'s with drag and
drop.

Aaron
 
B

Bart van Deenen

Jasen Betts said:
put them inside a div, the div will get events. , drag the div.
I tried it, but clicking inside the <input> element within the DIV will
still cause normal cursor handling for an input, it will not allow me to
drag the input field.
At the moment I'm just putting a padding around the input, so that you
can drag the span or div, but it would be nicer if one could drag the
whole input field around, instead of just its thick border.

Bart van Deenen
 
B

Bart van Deenen

Jasen Betts said:
Maybe you could put a transparent div over (Z-index) the input field, and
make the visible one follow the covering one...
That works, but it's inelegant. I just hoped one of you guys/gals would
think of something elegant.

Thanks for thinking with me.


Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top