[scriptaculous] dragging and <input> field

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bart van Deenen

    [scriptaculous] dragging and <input> field

    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

  • Aaron Gray

    #2
    Re: [scriptaculous] dragging and &lt;input&gt ; field

    > I have a form with a couple of input fields, embedded within spans. I am[color=blue]
    > 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?[/color]

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

    Aaron


    Comment

    • Jasen Betts

      #3
      Re: [scriptaculous] dragging and &lt;input&gt ; field

      On 2005-11-25, Bart van Deenen <bvdeenen@xs-four-all.nl.invalid> wrote:[color=blue]
      > 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?[/color]

      put them inside a div, the div will get events. , drag the div.



      Bye.
      Jasen

      Comment

      • Bart van Deenen

        #4
        Re: [scriptaculous] dragging and &lt;input&gt ; field

        Jasen Betts <jasen@free.net .nospam.nz> wrote:
        [color=blue]
        > put them inside a div, the div will get events. , drag the div.[/color]
        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

        Comment

        • Jasen Betts

          #5
          Re: [scriptaculous] dragging and &lt;input&gt ; field

          On 2005-11-28, Bart van Deenen <bvdeenen@xs-four-all.nl.invalid> wrote:
          [color=blue]
          > 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.[/color]

          Maybe you could put a transparent div over (Z-index) the input field, and
          make the visible one follow the covering one...

          Bye.
          Jasen

          Comment

          • Bart van Deenen

            #6
            Re: [scriptaculous] dragging and &lt;input&gt ; field

            Jasen Betts <jasen@free.net .nospam.nz> wrote:
            [color=blue]
            > Maybe you could put a transparent div over (Z-index) the input field, and
            > make the visible one follow the covering one...[/color]
            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

            Comment

            Working...