1 Reply Latest reply on Dec 14, 2007 1:43 PM by Günter Schenk

    NeXTensio Form + click on image for x y coordinates

      Hi all, I've been asked to implement a feature into a NeXTensio form
      containing two fields "x" and "y",
      so the user can click on an image to insert the x and y coordinates into the
      text-fields.

      How would you implement something like that?
      I've tried using
      but clicking on that
      image reloads the page.
      Is there some way to retrieve the coordinates of a click on on image field
      without having the click invoke submit?


      TIA

      Joris
        • 1. Re: NeXTensio Form + click on image for x y coordinates
          Günter Schenk Level 4
          Hi Joris,

          you can do that with a real image plus some javascript to store the x and y coordinates in two separate fields.

          1) Here´s an external javascript example which provides the basics:

          http://devshed.excudo.net/scripts/javascript/source/click%20and%20pick%20coordinates

          2) the function recordCoords() will need some slight modification to spread the values across two input fields:

          document.getElementById('x_field').value = xCoord;
          document.getElementById('y_field').value = yCoord;

          3) the img tag will need an onclick="recordCoords();" to trigger what´s mentioned in 2)

          worked fine for me so far

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver