473,657 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can you change the appearance of a radiobutton or checkbox?

Can you change the appearance of a radiobutton or checkbox?

I do not mean the apearance changes from checked to not checked or
disabled or not disabled, but change the appearance (of all these
states) to a total different set of images defined by img files?

Probably not I think?

Reason is I want some checkboxes to look a bit different then the
standard ones to implicitly say that these checkboxes have some special
function.

(Ok that's a bit vage, I know)

Dec 1 '05 #1
12 3902
In article <11************ **********@g14g 2000cwa.googleg roups.com>,
ma*********@hot mail.com says...
Can you change the appearance of a radiobutton or checkbox?

I do not mean the apearance changes from checked to not checked or
disabled or not disabled, but change the appearance (of all these
states) to a total different set of images defined by img files?

Probably not I think?

Reason is I want some checkboxes to look a bit different then the
standard ones to implicitly say that these checkboxes have some special
function.

(Ok that's a bit vage, I know)


You could create your own images set. Then change the current one and
set value of an hidden field (or variable) on the onClick event, through
javascript code.
Dec 1 '05 #2
>You could create your own images set. Then change the current one and
set value of an hidden field (or variable) on the onClick event, through
avascript code.


That seems to be too much effort for a too little appearance frange,
nothing easy out of the box I could use then? I would skip this then
until people really start to jangle that they cannot live without the
special looking checkbox!

But thanks for the suggestion of course.

Dec 1 '05 #3
ma*********@hot mail.com wrote:
Reason is I want some checkboxes to look a bit different then the
standard ones to implicitly say that these checkboxes have some
special function.


I've done something like this before and it worked well, but it depends on
your environment (having the wingdings 2 font available for all users).

<html>
<head>
<title></title>
<script type="text/javascript">
function clickTextCheckb ox(obj) {
if (obj.value=="") {
obj.value="P";
}
else {
obj.value="";
}
obj.blur();
}
</script>
<style type="text/css">
input.checkbox {
border:1px solid black;
font-family:"wingdin gs 2";
cursor:pointer;
}
</style>
</head>
<body>
<form>
<input type="text" class="checkbox " size="1"
onClick="clickT extCheckbox(thi s)" onFocus="this.b lur();">
</form>
</body>
</html>
--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 1 '05 #4
> I've done something like this before and it worked well, but it depends on
your environment (having the wingdings 2 font available for all users).


Well it is an intranet application not internet, so I can manage
certain standards on the client side, thanks for the suggestions

Dec 2 '05 #5
Matt Kruse wrote:
I've done something like this before and it worked well, but it depends on
your environment (having the wingdings 2 font available for all users).

<html>
<head>
<title></title>
Hm, hm.

<URL:http://validator.w3.or g/>
<URL:http://www.w3.org/QA/Tips/good-titles>
<script type="text/javascript">
function clickTextCheckb ox(obj) {
if (obj.value=="") {
obj.value="P";
}
else {
obj.value="";
}
obj.blur();
You should feature-test DOM methods before you call them.
<http://www.pointedears .de/scripts/test/whatami#test>
[...]
input.checkbox {
border:1px solid black;
font-family:"wingdin gs 2";


Sorry, no "Wingdings 2" font here, and you did not provide an alternative
font. Use Unicode character references (or hard-coded UTF sequences with
proper encoding declaration) instead. (I, too, made that particular
mistake before.)

<URL:http://ppewww.ph.gla.a c.uk/~flavell/unicode/unidata.html>
PointedEars
Dec 2 '05 #6
Thomas 'PointedEars' Lahn wrote:
<title></title> Hm, hm.


Quit nit-picking about things that have nothing to do with anything.
obj.blur();

You should feature-test DOM methods before you call them.


Not in controlled environments.
font-family:"wingdin gs 2";

Sorry, no "Wingdings 2" font here, and you did not provide an
alternative font.


I already said that it depends on your environment, and having wingdings2
available.
Use Unicode character references (or hard-coded
UTF sequences with proper encoding declaration) instead. (I, too,
made that particular mistake before.)


It's not a mistake. My machine/browser doesn't display the appropriate
unicode character, yet it displays the wingdings 2 character.

My example was a simple "proof of concept" and I qualified it by saying that
it dependeds on the user's environment. If you don't like it, don't use it.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Dec 2 '05 #7
> Not in controlled environments.

It's an intranet, so it is absolutely controlled. The only thing is,
that it is too much effort, for too little gain.

Or atleast it seems to be that way, at first sight. I will remember
your suggestion. If this would be absolutely necesarry for the
application, I will try it. But first I'll go back and ask if the
present state of the program is sufficient.

So thanks.

Dec 5 '05 #8
marc said the following on 12/5/2005 3:45 AM:
Not in controlled environments.

It's an intranet, so it is absolutely controlled. The only thing is,
that it is too much effort, for too little gain.


The script that Matt provided is "too much effort"? Yeesh.
Or atleast it seems to be that way, at first sight.


It's a simple onclick with a function and onfocus. Simple to add.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 5 '05 #9
It also involves installing wingdings on every client machine, if I am
not mistaking? That is more effort, if not the installing, the
procedures to change the client environment, getting the permission,
and questions to support if the thing does not work.

Dec 5 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4192
by: w.p. | last post by:
Hello! I want change default tab traversing in my app. But i don't know how to do it :( Belowe i include simple example - i want change default tab order: radiobutton "mode11" -> radiobutton "mode31" -> button OK I can't find any option, flag, or another way.
0
2098
by: Ashish Shridharan | last post by:
Hi All, Has anyone ever tried disabling a checkbox or a radiobutton web server control in netscape ? While a textbox and a button control renders disabled, .NET adds the disabled attribute to the span tag in the case of a checkbox or a radiobutton. Effectively, these controls are not disabled in netscape.
1
3582
by: rozrabiak | last post by:
Hi! I have problem witch Windows forms, CheckBox, RadioButton, ComboBox and database. How can I use checkbox (and other components) in database? I want to check the checkbox in My form and save changes in to database, but it return me an Exception: "Nothing changed", WHY? I'm using MSSQL MSDE.
2
3861
by: alien2_51 | last post by:
Can some one tell me why the onclick is firing twice for the radion button and checkbox controls...? <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Testing.aspx.vb" Inherits="CustomerRelations.Testing" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Testing</title> <!--
2
1902
by: John Holmes | last post by:
I am using radioButton controls in a data repeater and would like to incorporate the 'key' field into the 'id' attribute of the radioButton controls and name them something like: 'rad' + '<%# (string)DataBinder.Eval(Container.DataItem, "ParcelID") %>' + PropType1 I think part of the problem is that intially there is no data bound to this repeater section. The data doesn't get built until the user clicks a button on the form and then...
4
1766
by: Ricky W. Hunt | last post by:
Is there an easy, flexible way to determine which radiobutton is checked within a groupbox without having to code for each button explicitly? It seems there would be some kind of index you could use but I can't find anything in the VS help or on MSDN online. Something like: (pseudocode) If grpBox1.item(3).checked then
5
1954
by: Web learner | last post by:
I have to have three RadioButtons and then under one of this RadioButton, I need to put two checkboxes. Something like following: O Temperature Air Water O Radiaton O Wind Velocity The child CheckBoxes (Air and Water in above example) should become
4
1602
by: Igor | last post by:
RadioButton have property Checked (true or false). If I make RadioButtons with code, without drawing by mouse than I have problems. I write like this: Dim rb(0 To 2) As RadioButton Dim n As Integer For n = 0 To 2 rb(n) = New RadioButton rb(n).Text = "Text: " + CStr(n)
0
1298
by: Nathan Sokalski | last post by:
In the RadioButton and CheckBox controls, there is no Value attribute. The html <inputtag has a value attribute, which is used by both type="radio" and type="checkbox". The RadioButtonList and CheckBoxList controls have SelectedValue properties (I realize that the RadioButtonList uses the <selectand <optiontags instead of the <inputtag, but needing a value server-side exists either way). I am attempting to write a control with...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.