dual state button

Discussion in 'HTML' started by Martin John Brindle, Aug 7, 2005.

  1. How can I make an ordinary html button behave like a checkbox? That is, I
    need it to stay sunk if i click on it and then popup when clicked again?
     
    Martin John Brindle, Aug 7, 2005
    #1
    1. Advertising

  2. Martin John Brindle

    SpaceGirl Guest

    Martin John Brindle wrote:
    > How can I make an ordinary html button behave like a checkbox? That is, I
    > need it to stay sunk if i click on it and then popup when clicked again?
    >
    >


    You'll need to use script to do that. Draw two images, one of your
    button "up" and one of your button "down". Something like this should work:

    <img src="button_up.gif" onclick="this.src='button_down.gif';" />

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    # this post (c) Miranda Thomas 2005
    # explicitly no permission given to Forum4Designers
    # to duplicate this post.
     
    SpaceGirl, Aug 7, 2005
    #2
    1. Advertising

  3. Martin John Brindle

    Philip Ronan Guest

    "Martin John Brindle" wrote:

    > How can I make an ordinary html button behave like a checkbox? That is, I
    > need it to stay sunk if i click on it and then popup when clicked again?


    You can't. Otherwise it wouldn't be an ordinary HTML button.

    You could fake it with a scripted graphic element, but why bother? You'll
    only end up making your site frustrating and/or unusable. What you're
    proposing is about as logical as making scrollbars that behave like pop-up
    menus.

    If you want something that behaves like a checkbox, then use a checkbox.

    --
    phil [dot] ronan @ virgin [dot] net
    http://vzone.virgin.net/phil.ronan/
     
    Philip Ronan, Aug 7, 2005
    #3
  4. "Philip Ronan" <> wrote in message
    news:BF1BA9FE.3606D%...
    > "Martin John Brindle" wrote:
    >
    >> How can I make an ordinary html button behave like a checkbox? That is, I
    >> need it to stay sunk if i click on it and then popup when clicked again?

    >
    > You can't. Otherwise it wouldn't be an ordinary HTML button.


    By HTML "button", I'm referring to the element, or the "input button"
    element, which has the appearance of the OS's button. In my case IE6.

    >
    > You could fake it with a scripted graphic element, but why bother?


    Because I want a button that stays sunk when clicked. If I need to use
    script, that's not a problem.


    You'll only end up making your site frustrating and/or unusable. What
    you're
    > proposing is about as logical as making scrollbars that behave like pop-up
    > menus.


    I'm not writing a website...!

    >
    > If you want something that behaves like a checkbox, then use a checkbox.
    >
    > --
    > phil [dot] ronan @ virgin [dot] net
    > http://vzone.virgin.net/phil.ronan/
    >
    >
     
    Martin John Brindle, Aug 7, 2005
    #4
  5. Martin John Brindle

    dorayme Guest

    > From: "Martin John Brindle" <>
    >
    > How can I make an ordinary html button behave like a checkbox? That is, I
    > need it to stay sunk if i click on it and then popup when clicked again?
    >
    >


    If you do not use a proper checkbox and must have a graphic html link
    that looks like a checkbox, then I suppose you could make the link go to
    an almost identical html page, the only difference being the checkbox
    graphic there has a X in it and is not part of a link, ie. not wrapped
    in <a href="">...</a>. Not wrapped because you want it staying sunk
    (crossed).

    dorayme
     
    dorayme, Aug 7, 2005
    #5
  6. "Martin John Brindle" <> wrote in message
    news:UtlJe.12673$...
    > How can I make an ordinary html button behave like a checkbox? That is, I
    > need it to stay sunk if i click on it and then popup when clicked again?
    >


    It seems the answer is going to be that I need to take a picture of my
    windows XP button, while sunk, and replace the image on that button when
    clicked, which will look naff when it's run on NT!

    I was hoping for a button or checkbox style that allows for this.

    Thanks for your help.
     
    Martin John Brindle, Aug 7, 2005
    #6
  7. Martin John Brindle wrote:
    > I'm not writing a website...!


    Unless you say otherwise, it would be assumed that posing your
    question in an HTML authoring group, you are writing a web site.

    What are you writing?

    --
    -bts
    -This space intentionally left blank.
     
    Beauregard T. Shagnasty, Aug 7, 2005
    #7
  8. Martin John Brindle

    SpaceGirl Guest

    Martin John Brindle wrote:
    > "Martin John Brindle" <> wrote in message
    > news:UtlJe.12673$...
    >
    >>How can I make an ordinary html button behave like a checkbox? That is, I
    >>need it to stay sunk if i click on it and then popup when clicked again?
    >>

    >
    >
    > It seems the answer is going to be that I need to take a picture of my
    > windows XP button, while sunk, and replace the image on that button when
    > clicked, which will look naff when it's run on NT!
    >
    > I was hoping for a button or checkbox style that allows for this.
    >
    > Thanks for your help.
    >
    >


    Well yes, except that not everyone will see your XP button on a web
    page. What if I'm not using XP? What if I am using XP but I have a
    different theme loaded? In both cases your button would look completely
    different to any other button on your page.

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
    # this post (c) Miranda Thomas 2005
    # explicitly no permission given to Forum4Designers
    # to duplicate this post.
     
    SpaceGirl, Aug 7, 2005
    #8
  9. "Beauregard T. Shagnasty" <> wrote in message
    news:iloJe.2712$...
    > Martin John Brindle wrote:
    >> I'm not writing a website...!

    >
    > Unless you say otherwise, it would be assumed that posing your question in
    > an HTML authoring group, you are writing a web site.


    I was just posing an html question to an html newsgroup.

    >
    > What are you writing?
    >


    I have an activex webcontrol, which i'm using to create an html control of
    all the items on that dialog, using MFC etc...

    > --
    > -bts
    > -This space intentionally left blank.
     
    Martin John Brindle, Aug 7, 2005
    #9
  10. Martin John Brindle

    Philip Ronan Guest

    "Martin John Brindle" wrote:

    > It seems the answer is going to be that I need to take a picture of my
    > windows XP button, while sunk, and replace the image on that button when
    > clicked, which will look naff when it's run on NT!


    That's what I meant when I said you could fake it with a scripted graphic
    element. If you like wasting time, then check the navigator.userAgent
    property and choose an image that suits the visitor's particular browser.

    > I was hoping for a button or checkbox style that allows for this.


    Doesn't exist. You want something that behaves like a checkbox. So use a
    checkbox.

    --
    phil [dot] ronan @ virgin [dot] net
    http://vzone.virgin.net/phil.ronan/
     
    Philip Ronan, Aug 7, 2005
    #10
    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. Nicolas Matringe

    Synthesizable (kind of) dual-edge FF

    Nicolas Matringe, Sep 27, 2004, in forum: VHDL
    Replies:
    1
    Views:
    936
    Ralf Hildebrandt
    Oct 12, 2004
  2. john

    FPGA and Dual Port RAM

    john, Nov 3, 2004, in forum: VHDL
    Replies:
    2
    Views:
    3,626
  3. john

    Dual port RAM

    john, Nov 4, 2004, in forum: VHDL
    Replies:
    1
    Views:
    790
    mike_treseler
    Nov 4, 2004
  4. dwerdna

    Dual port Ram - for beginners

    dwerdna, Apr 3, 2005, in forum: VHDL
    Replies:
    7
    Views:
    23,504
    dwerdna
    Apr 8, 2005
  5. Thomas Fischer
    Replies:
    2
    Views:
    3,342
    Paul Uiterlinden
    Apr 11, 2005
Loading...

Share This Page