Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > dual state button

Reply
Thread Tools

dual state button

 
 
Martin John Brindle
Guest
Posts: n/a
 
      08-07-2005
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?


 
Reply With Quote
 
 
 
 
SpaceGirl
Guest
Posts: n/a
 
      08-07-2005
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.
 
Reply With Quote
 
 
 
 
Philip Ronan
Guest
Posts: n/a
 
      08-07-2005
"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/


 
Reply With Quote
 
Martin John Brindle
Guest
Posts: n/a
 
      08-07-2005

"Philip Ronan" <(E-Mail Removed)> wrote in message
news:BF1BA9FE.3606D%(E-Mail Removed)...
> "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/
>
>



 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-07-2005
> From: "Martin John Brindle" <(E-Mail Removed)>
>
> 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

 
Reply With Quote
 
Martin John Brindle
Guest
Posts: n/a
 
      08-07-2005

"Martin John Brindle" <(E-Mail Removed)> wrote in message
news:UtlJe.12673$(E-Mail Removed)...
> 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.


 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      08-07-2005
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.
 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      08-07-2005
Martin John Brindle wrote:
> "Martin John Brindle" <(E-Mail Removed)> wrote in message
> news:UtlJe.12673$(E-Mail Removed)...
>
>>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.
 
Reply With Quote
 
Martin John Brindle
Guest
Posts: n/a
 
      08-07-2005

"Beauregard T. Shagnasty" <(E-Mail Removed)> wrote in message
news:iloJe.2712$(E-Mail Removed)...
> 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.



 
Reply With Quote
 
Philip Ronan
Guest
Posts: n/a
 
      08-07-2005
"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/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C3845, Dual Hub Dual DMVPN Hub-To-Spoke, Limitations? Dennis Breithaupt Cisco 9 08-21-2007 09:35 PM
NetGear SPH200D dual Dual-mode, Cordless Phone vs Dualphone 3088 dual mode cordless phone Paul NZ Computing 0 05-08-2007 09:06 AM
photo computers: dual core, dual cpu, or single? Roger N. Clark (change username to rnclark) Digital Photography 21 06-20-2006 06:13 AM
dual core vs. dual processor Ben Markson Computer Information 44 11-14-2005 04:33 AM
Advice needed for new PC: dual Xeon or dual Opteron, or neither... Toby Computer Information 65 04-22-2004 12:30 AM



Advertisments