Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to 'capture' coordinates.

Status
Not open for further replies.

Bramvg

IS-IT--Management
Jan 16, 2001
135
BE

Hi there. I'm looking for a script that enables me to 'capture' the coordinates of an image.
Say that I have a blank page that displays only an image. Than I would like to have a script, let's say
with " x - y lines" so I can select a certain section of the image. This would be the coordinates for an IMAGEMAP!

The coordinates I would have selected would have to appear in an 'text input' field so I can send it to my database.

Does anyone of you can help me on this? Or point me to a site where you might have seen something similar?

With kind regards and many thanks.
Bram
 
Try this:


========================
My Form

<FORM action=&quot;multiimage.cfm&quot; method=&quot;post&quot;>
<input type=&quot;image&quot; src=&quot;multibutton.gif&quot; width=&quot;233&quot; height=&quot;16&quot; border=&quot;0&quot;>
</FORM>


<cfif isdefined('Form.X')>

<cfif X LT 62>
YOU HAVE SELECTED SIGN IN
<cfelse>
YOU HAVE REQUESTED YOUR PASSWORD
</cfif>

</cfif>
========================
 
Hi CFHub,

This has helped me out very much!
But now I have one more question :)


I would like these coordinates (x,y) to use in a javascript form. Saying: the person clicks first in the upper left corner and these coordinates are shown in a text input field, than the user clicks in the middle of the screen and these coordinates are shown in the second text input field. Than the user clicks on OK in order to save the data.

I want to avoid to do in 2 pages what I can do in one page;-)

Could you help me on this?

Greetz and tnx
bram
 
Although you can put all the code on one page:

<cfif IsDefined('Form.X')>

..write your JavaScript code...

</cfif>

To make use of Form variables in CF the data must be sent to the server (a page reload)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top