input image submits x,y

Discussion in 'HTML' started by jshanman, Sep 30, 2008.

  1. jshanman

    jshanman Guest

    Here is my issue:

    I have a form that submits a search using the GET method (for
    bookmarking purposes) but the form has an <input type='image'...>
    element for the submit button to make it pretty. When this submits,
    it also submits the ?x=10&y=15 garbage into the url which makes it
    ugly. Is there any simple way to avoid this without resorting to
    javascript initiating the script?
     
    jshanman, Sep 30, 2008
    #1
    1. Advertising

  2. Gazing into my crystal ball I observed jshanman <>
    writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    @z66g2000hsc.googlegroups.com:

    > Here is my issue:
    >
    > I have a form that submits a search using the GET method (for
    > bookmarking purposes) but the form has an <input type='image'...>
    > element for the submit button to make it pretty. When this submits,
    > it also submits the ?x=10&y=15 garbage into the url which makes it
    > ugly. Is there any simple way to avoid this without resorting to
    > javascript initiating the script?


    There is no way to do this in HTML, but you could always change it to
    submit and use CSS to style it, eg:

    input.submit {background-image: url(button.gif};}

    <input type="submit" class="submit" value="Submit">


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Oct 1, 2008
    #2
    1. Advertising

  3. jshanman

    jshanman Guest

    On Oct 1, 8:57 am, Adrienne Boswell <> wrote:
    > Gazing into my crystal ball I observed jshanman <>
    > writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    > @z66g2000hsc.googlegroups.com:
    >
    > > Here is my issue:

    >
    > > I have a form that submits a search using the GET method (for
    > > bookmarking purposes) but the form has an <input type='image'...>
    > > element for the submit button to make it pretty.  When this submits,
    > > it also submits the ?x=10&y=15 garbage into the url which makes it
    > > ugly.  Is there any simple way to avoid this without resorting to
    > > javascript initiating the script?

    >
    > There is no way to do this in HTML, but you could always change it to
    > submit and use CSS to style it, eg:
    >
    > input.submit {background-image: url(button.gif};}
    >
    > <input type="submit" class="submit" value="Submit">
    >
    > --
    > Adrienne Boswell at Home
    > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    > Please respond to the group so others can share


    Perfect, thanks! I hadn't thought of setting background css on an
    input button/submit element.

    - jshanman
     
    jshanman, Oct 1, 2008
    #3
  4. jshanman

    jshanman Guest

    On Oct 1, 1:38 pm, jshanman <> wrote:
    > On Oct 1, 8:57 am, Adrienne Boswell <> wrote:
    >
    >
    >
    > > Gazing into my crystal ball I observed jshanman <>
    > > writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    > > @z66g2000hsc.googlegroups.com:

    >
    > > > Here is my issue:

    >
    > > > I have a form that submits a search using the GET method (for
    > > > bookmarking purposes) but the form has an <input type='image'...>
    > > > element for the submit button to make it pretty.  When this submits,
    > > > it also submits the ?x=10&y=15 garbage into the url which makes it
    > > > ugly.  Is there any simple way to avoid this without resorting to
    > > > javascript initiating the script?

    >
    > > There is no way to do this in HTML, but you could always change it to
    > > submit and use CSS to style it, eg:

    >
    > > input.submit {background-image: url(button.gif};}

    >
    > > <input type="submit" class="submit" value="Submit">

    >
    > > --
    > > Adrienne Boswell at Home
    > > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    > > Please respond to the group so others can share

    >
    > Perfect, thanks!  I hadn't thought of setting background css on an
    > input button/submit element.
    >
    > - jshanman


    Actually it turns out that IE doesn't like a background-image property
    on a submit element. Oh well :/
     
    jshanman, Oct 1, 2008
    #4
  5. Gazing into my crystal ball I observed jshanman <>
    writing in news:4bd43425-dc53-4c90-bfeb-
    :

    > On Oct 1, 1:38 pm, jshanman <> wrote:
    >> On Oct 1, 8:57 am, Adrienne Boswell <> wrote:
    >>
    >>
    >>
    >> > Gazing into my crystal ball I observed jshanman <jshan...

    @gmail.com>
    >> > writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    >> > @z66g2000hsc.googlegroups.com:

    >>
    >> > > Here is my issue:

    >>
    >> > > I have a form that submits a search using the GET method (for
    >> > > bookmarking purposes) but the form has an <input type='image'...>
    >> > > element for the submit button to make it pretty.  When this

    submits
    > ,
    >> > > it also submits the ?x=10&y=15 garbage into the url which makes i

    > t
    >> > > ugly.  Is there any simple way to avoid this without resorting to
    >> > > javascript initiating the script?

    >>
    >> > There is no way to do this in HTML, but you could always change it

    to
    >> > submit and use CSS to style it, eg:

    >>
    >> > input.submit {background-image: url(button.gif};}

    >>
    >> > <input type="submit" class="submit" value="Submit">

    >>
    >> > --
    >> > Adrienne Boswell at Home
    >> > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    >> > Please respond to the group so others can share

    >>
    >> Perfect, thanks!  I hadn't thought of setting background css on an
    >> input button/submit element.
    >>
    >> - jshanman

    >
    > Actually it turns out that IE doesn't like a background-image property
    > on a submit element. Oh well :/
    >


    Yes, it does. Do you have a URL where it does not work? I have one
    that does:
    http://www.cavalcade-of-coding.info/testinput.html

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Oct 2, 2008
    #5
  6. jshanman

    jshanman Guest

    On Oct 1, 8:31 pm, Adrienne Boswell <> wrote:
    > Gazing into my crystal ball I observed jshanman <>
    > writing in news:4bd43425-dc53-4c90-bfeb-
    > :
    >
    >
    >
    >
    >
    > > On Oct 1, 1:38 pm, jshanman <> wrote:
    > >> On Oct 1, 8:57 am, Adrienne Boswell <> wrote:

    >
    > >> > Gazing into my crystal ball I observed jshanman <jshan...

    > @gmail.com>
    > >> > writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    > >> > @z66g2000hsc.googlegroups.com:

    >
    > >> > > Here is my issue:

    >
    > >> > > I have a form that submits a search using the GET method (for
    > >> > > bookmarking purposes) but the form has an <input type='image'...>
    > >> > > element for the submit button to make it pretty.  When this

    > submits
    > > ,
    > >> > > it also submits the ?x=10&y=15 garbage into the url which makes i

    > > t
    > >> > > ugly.  Is there any simple way to avoid this without resorting to
    > >> > > javascript initiating the script?

    >
    > >> > There is no way to do this in HTML, but you could always change it

    > to
    > >> > submit and use CSS to style it, eg:

    >
    > >> > input.submit {background-image: url(button.gif};}

    >
    > >> > <input type="submit" class="submit" value="Submit">

    >
    > >> > --
    > >> > Adrienne Boswell at Home
    > >> > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    > >> > Please respond to the group so others can share

    >
    > >> Perfect, thanks!  I hadn't thought of setting background css on an
    > >> input button/submit element.

    >
    > >> - jshanman

    >
    > > Actually it turns out that IE doesn't like a background-image property
    > > on a submit element.  Oh well :/

    >
    > Yes, it does.  Do you have a URL where it does not work?  I have one
    > that does:http://www.cavalcade-of-coding.info/testinput.html
    >
    > --
    > Adrienne Boswell at Home
    > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    > Please respond to the group so others can share


    IE didn't like my border: none that I had defined in the same
    element.style

    Didn't work in IE:
    <input type="submit" style="background-image: url(btn_go.gif); width:
    54px; height: 24px; border: none;" value="" class="searchButton" />

    Works OK:
    <input type="submit" style="background-image: url(btn_go.gif); width:
    54px; height: 24px; border: 0px;" value="" class="searchButton" />

    Thanks,
    - jshanman
     
    jshanman, Oct 2, 2008
    #6
  7. Gazing into my crystal ball I observed jshanman <>
    writing in news:bbc27731-d43a-44ee-97a8-
    :

    > On Oct 1, 8:31 pm, Adrienne Boswell <> wrote:
    >> Gazing into my crystal ball I observed jshanman <>
    >> writing in news:4bd43425-dc53-4c90-bfeb-
    >> :
    >>
    >>
    >>
    >>
    >>
    >> > On Oct 1, 1:38 pm, jshanman <> wrote:
    >> >> On Oct 1, 8:57 am, Adrienne Boswell <> wrote:

    >>
    >> >> > Gazing into my crystal ball I observed jshanman <jshan...

    >> @gmail.com>
    >> >> > writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    >> >> > @z66g2000hsc.googlegroups.com:

    >>
    >> >> > > Here is my issue:

    >>
    >> >> > > I have a form that submits a search using the GET method (for
    >> >> > > bookmarking purposes) but the form has an <input

    type='image'...
    >>
    >> >> > > element for the submit button to make it pretty.  When this

    >> submits
    >> > ,
    >> >> > > it also submits the ?x=10&y=15 garbage into the url which make

    > s i
    >> > t
    >> >> > > ugly.  Is there any simple way to avoid this without resorting

    t
    > o
    >> >> > > javascript initiating the script?

    >>
    >> >> > There is no way to do this in HTML, but you could always change

    it
    >> to
    >> >> > submit and use CSS to style it, eg:

    >>
    >> >> > input.submit {background-image: url(button.gif};}

    >>
    >> >> > <input type="submit" class="submit" value="Submit">

    >>
    >> >> > --
    >> >> > Adrienne Boswell at Home
    >> >> > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-

    coding.info
    >> >> > Please respond to the group so others can share

    >>
    >> >> Perfect, thanks!  I hadn't thought of setting background css on an
    >> >> input button/submit element.

    >>
    >> >> - jshanman

    >>
    >> > Actually it turns out that IE doesn't like a background-image

    property
    >> > on a submit element.  Oh well :/

    >>
    >> Yes, it does.  Do you have a URL where it does not work?  I have one
    >> that does:http://www.cavalcade-of-coding.info/testinput.html
    >>
    >> --
    >> Adrienne Boswell at Home
    >> Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    >> Please respond to the group so others can share

    >
    > IE didn't like my border: none that I had defined in the same
    > element.style
    >
    > Didn't work in IE:
    ><input type="submit" style="background-image: url(btn_go.gif); width:
    > 54px; height: 24px; border: none;" value="" class="searchButton" />
    >
    > Works OK:
    ><input type="submit" style="background-image: url(btn_go.gif); width:
    > 54px; height: 24px; border: 0px;" value="" class="searchButton" />
    >
    > Thanks,
    > - jshanman
    >


    Inline style like that is a bad idea, better to put it into an external
    style sheet. That way, you don't have to go hunting around if your
    client wants to change it later.

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Oct 2, 2008
    #7
  8. jshanman

    jshanman Guest

    On Oct 2, 10:35 am, Adrienne Boswell <> wrote:
    > Gazing into my crystal ball I observed jshanman <>
    > writing in news:bbc27731-d43a-44ee-97a8-
    > :
    >
    >
    >
    >
    >
    > > On Oct 1, 8:31 pm, Adrienne Boswell <> wrote:
    > >> Gazing into my crystal ball I observed jshanman <>
    > >> writing in news:4bd43425-dc53-4c90-bfeb-
    > >> :

    >
    > >> > On Oct 1, 1:38 pm, jshanman <> wrote:
    > >> >> On Oct 1, 8:57 am, Adrienne Boswell <> wrote:

    >
    > >> >> > Gazing into my crystal ball I observed jshanman <jshan...
    > >> @gmail.com>
    > >> >> > writing in news:2f7c2178-0013-4c23-a062-e7c8723bc937
    > >> >> > @z66g2000hsc.googlegroups.com:

    >
    > >> >> > > Here is my issue:

    >
    > >> >> > > I have a form that submits a search using the GET method (for
    > >> >> > > bookmarking purposes) but the form has an <input

    > type='image'...
    >
    > >> >> > > element for the submit button to make it pretty.  When this
    > >> submits
    > >> > ,
    > >> >> > > it also submits the ?x=10&y=15 garbage into the url which make

    > > s i
    > >> > t
    > >> >> > > ugly.  Is there any simple way to avoid this without resorting

    > t
    > > o
    > >> >> > > javascript initiating the script?

    >
    > >> >> > There is no way to do this in HTML, but you could always change

    > it
    > >> to
    > >> >> > submit and use CSS to style it, eg:

    >
    > >> >> > input.submit {background-image: url(button.gif};}

    >
    > >> >> > <input type="submit" class="submit" value="Submit">

    >
    > >> >> > --
    > >> >> > Adrienne Boswell at Home
    > >> >> > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-

    > coding.info
    > >> >> > Please respond to the group so others can share

    >
    > >> >> Perfect, thanks!  I hadn't thought of setting background css on an
    > >> >> input button/submit element.

    >
    > >> >> - jshanman

    >
    > >> > Actually it turns out that IE doesn't like a background-image

    > property
    > >> > on a submit element.  Oh well :/

    >
    > >> Yes, it does.  Do you have a URL where it does not work?  I have one
    > >> that does:http://www.cavalcade-of-coding.info/testinput.html

    >
    > >> --
    > >> Adrienne Boswell at Home
    > >> Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    > >> Please respond to the group so others can share

    >
    > > IE didn't like my border: none that I had defined in the same
    > > element.style

    >
    > > Didn't work in IE:
    > ><input type="submit" style="background-image: url(btn_go.gif); width:
    > > 54px; height: 24px; border: none;" value="" class="searchButton" />

    >
    > > Works OK:
    > ><input type="submit" style="background-image: url(btn_go.gif); width:
    > > 54px; height: 24px; border: 0px;" value="" class="searchButton" />

    >
    > > Thanks,
    > > - jshanman

    >
    > Inline style like that is a bad idea, better to put it into an external
    > style sheet.  That way, you don't have to go hunting around if your
    > client wants to change it later.
    >
    > --
    > Adrienne Boswell at Home
    > Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info
    > Please respond to the group so others can share


    Thanks for the advice. I'm glad I thought of it. I just put them
    inline for example purposes.

    - jshanman
     
    jshanman, Oct 2, 2008
    #8
  9. jshanman

    Guest

    On Oct 2, 5:11 pm, jshanman <> wrote:
    > > > IE didn't like my border: none that I had defined in the same
    > > > element.style


    I think that you still have the problem
    that you cannot specify the text for the
    submit button, for example lynx will give
    the default value Submit if you have
    <input type="submit" value="" class="something" />
    that is OK I suppose if you do not want a
    different text.
    With an image button you can specify the text
    of the button with the alt attribute.

    I think that if you do not like the
    x=value&y=value in the query string,
    it is better to have a submit button
    without an image, you can
    make it prettier by setting the
    colour and font of the text in the stylesheet.
     
    , Oct 4, 2008
    #9
    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. Robert V
    Replies:
    1
    Views:
    1,179
    Jeremy Fluhmann
    Jul 21, 2003
  2. Scott M.

    Run JavaScript before Form Submits

    Scott M., Nov 17, 2003, in forum: ASP .Net
    Replies:
    14
    Views:
    7,076
    Joe Gass
    Nov 18, 2003
  3. Stan
    Replies:
    1
    Views:
    2,523
    Jacob Yang [MSFT]
    Dec 3, 2003
  4. David Williams

    Input Submits in Explorer

    David Williams, Oct 31, 2007, in forum: Javascript
    Replies:
    3
    Views:
    88
  5. okey
    Replies:
    3
    Views:
    88
    Thomas 'PointedEars' Lahn
    Oct 3, 2009
Loading...

Share This Page