Hello all, I'm trying to create some alternative checkboxes, radio buttons and select drop-down boxes. They will be 100% text based using JavaScript. Here is an example:
[ ] I am a blank checkbox
[/] I am a checked checkbox
( ) I am a blank radio button
(*) I am a checked radio button
The script for the checkboxes is simple, and I would know how to manipulate them with PHP, but the problem lies in the radio buttons, and deselecting other radio buttons in a group. I'd prefer it based on the ID attribute of the INPUT element. For example: radio_1, radio_2 and radio_3 are all part of the radio group, and they have the values 1, 2 and 3. If I ticked radio_2, I would like radio_1 and radio_3 to uncheck themselves!
Here is a bit of code:
Code:
function tick(o){
var type=o.innerHTML.substr(0,1);
var fill=o.innerHTML.substr(1,1);
switch(type){
case "[":
if(fill=="/"){ o.innerHTML="[ ]"; }
else{ o.innerHTML="[/]"; }
break;
case "(":
// Stuck
break;
}
}
More info when I get home later.
See you!