Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 597169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:15:04+00:00 2026-05-13T16:15:04+00:00

I have an input set to a type of image: <form id=MapForm action=#> <input

  • 0

I have an input set to a type of image:

<form id="MapForm" action="#">
    <input type="image" src="usa.jpg" id="usa_map" alt="USA"/>
</form>

I want to attach a function so that I can get the X & Y coordinates where a person clicked:

$('#MapForm').submit(ClickOnMap);
function ClickOnMap(data)
{
    return false;
}

I cannot find the X & Y coordinates inside ‘data’. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:15:05+00:00Added an answer on May 13, 2026 at 4:15 pm

    There’s a good tutorial on this here, in the jQuery docs:

    $('#usa_map').click(function(e){
    
      //Grab click position, mis the offset of the image to get the position inside
      var x = e.pageX - this.offsetLeft;
      var y = e.pageY - this.offsetTop;
      alert('X: ' + x + ', Y: ' + y);
    
      //set 2 form field inputs if you want to store/post these values
      //e.g. $("#usa_map_x").val(x); $("#usa_map_y").val(y);
    
      //Submit the form
      $('#MapForm').submit();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a control: <input id=trigger_update_submit type=image src=images/green_flag.png alt= name=set_this value=uu /> This control
hey, well I have this form <form method=POST action=''> <input type=hidden name=op value=download1> <input
I have an input field that is by default set to type=text so that
As input I have a set of triangles that form concave mesh with holes.
In my form I have a set of input boxes where a user can
I have set of images and checkboxes like below <form name=food_type_form method=post action=proc.php> <img
I have used input type image to display my custom style buttons, but for
I have a simple input field inside a form tag: <body> <form action=#> <label>Input</label>
I have a form with field <input type=file name=file size=100 value=> if this field
I have an arraylist set up. I have input instuctions set up too, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.