input type=text and firefox versus ie

J

johnebullock

I am using an image input object to return the coordinates of a mouse
click in a form submit. This is working fine with one exception. In
IE the (x,y) are relative to the image, but in Firefox they are
relative to the frame. For example, a click on the image in IE
returns (5,5) but in Firefox the same location click returns (75,39).
Here is the html from the page:

<INPUT TYPE='image' STYLE='position:absolute;left:70;top:34;'
ID='lbl_image' NOSAVE ALIGN='top' BORDER='0' WIDTH='300' HEIGHT='100'
SRC='../../../cgi-bin/gtrtlm/c_lbl_image.cgi>

I say the Firefox coordinates returned are relative to the frame
because the style command that positions the image is the same offset
coming back in my (x,y) pair.

Is this normal behavior for Firefox, and if so, what is the best way
to code around it so the correct image relative coordinates are
returned?
 
M

marss

I am using an image input object to return the coordinates of a mouse
click in a form submit. This is working fine with one exception. In
IE the (x,y) are relative to the image, but in Firefox they are
relative to the frame. For example, a click on the image in IE
returns (5,5) but in Firefox the same location click returns (75,39).
Here is the html from the page:

<INPUT TYPE='image' STYLE='position:absolute;left:70;top:34;'
ID='lbl_image' NOSAVE ALIGN='top' BORDER='0' WIDTH='300' HEIGHT='100'
SRC='../../../cgi-bin/gtrtlm/c_lbl_image.cgi>

Try this approach:
<span STYLE='position:absolute;left:70;top:34;'>
<INPUT TYPE='image' STYLE='position:relative;' ID='lbl_image' ... >
<span>

Regards, Mykola
http://marss.co.ua
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
I am using an image input object to return the coordinates of a mouse
click in a form submit. This is working fine with one exception.

You mean people who cannot click on a particular location because they are
using a speech browser or they suffer from motoric disability or they lack a
mouse right now or they just don't understand the concept?
In IE the (x,y) are relative to the image, but in Firefox they are
relative to the frame.

Frame? What frame? Why don't you post a URL?
Here is the html from the page:

<INPUT TYPE='image' STYLE='position:absolute;left:70;top:34;'
ID='lbl_image' NOSAVE ALIGN='top' BORDER='0' WIDTH='300' HEIGHT='100'
SRC='../../../cgi-bin/gtrtlm/c_lbl_image.cgi>

It's invalid markup, and it contains incorrect CSS code (the declarations
for left and top are ignored by conforming browsers), so what can you
expect?
 
J

johnebullock

Scripsit (e-mail address removed):


You mean people who cannot click on a particular location because they are
using a speech browser or they suffer from motoric disability or they lack a
mouse right now or they just don't understand the concept?


Frame? What frame? Why don't you post a URL?



It's invalid markup, and it contains incorrect CSS code (the declarations
for left and top are ignored by conforming browsers), so what can you
expect?

It's running on a private corporate firewalled site, so I can't post
the URL or I would have.

I figured out another way to do it, I was really just curious why the
difference in coordinates returned. I have since found a lot of other
inconsistencies as well, and
will know to code around them in the future.

By the way, the positioning does work in Firefox and IE, even if it's
invalid markup. Those are the only two browsers the customer will be
using. How is the markup invalid anyways?
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top