dual state button

  • Thread starter Martin John Brindle
  • Start date
M

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

SpaceGirl

Martin said:
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.
 
P

Philip Ronan

Martin John Brindle said:
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.
 
M

Martin John Brindle

Philip Ronan said:
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...!
 
D

dorayme

From: "Martin John Brindle said:
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
 
M

Martin John Brindle

Martin John Brindle said:
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.
 
B

Beauregard T. Shagnasty

Martin said:
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?
 
S

SpaceGirl

Martin said:
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.
 
M

Martin John Brindle

Beauregard T. Shagnasty said:
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...
 
P

Philip Ronan

Martin John Brindle said:
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.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top