input type=text and firefox versus ie

Discussion in 'HTML' started by johnebullock@hotmail.com, Jul 4, 2007.

  1. Guest

    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?
     
    , Jul 4, 2007
    #1
    1. Advertising

  2. marss Guest

    wrote:
    > 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
     
    marss, Jul 5, 2007
    #2
    1. Advertising

  3. Scripsit :

    > 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?

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 5, 2007
    #3
  4. Guest

    On Jul 5, 5:41 pm, "Jukka K. Korpela" <> wrote:
    > Scripsit :
    >
    > > I am using an imageinputobject 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?
    >
    > > InIEthe (x,y) are relative to the image, but inFirefoxthey are
    > > relative to the frame.

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

    >
    > > <INPUTTYPE='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?
    >
    > --
    > Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/


    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?
     
    , Jul 7, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    1
    Views:
    6,936
    Scott M.
    Oct 11, 2003
  2. Russ

    script versus code versus ?

    Russ, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,502
  3. paulo
    Replies:
    9
    Views:
    713
    James Kanze
    Mar 6, 2009
  4. Christoffer Sawicki
    Replies:
    5
    Views:
    261
    Christoffer Sawicki
    Sep 2, 2006
  5. Paul Butcher
    Replies:
    12
    Views:
    723
    Gary Wright
    Nov 28, 2007
Loading...

Share This Page