Techious http://www.techious.com/forums/ |
|
Alternative checkboxes and radio's! http://www.techious.com/forums/viewtopic.php?f=8&t=581 |
Page 1 of 1 |
Author: | azcn2503 [ Wed Apr 26, 2006 3:27 pm ] |
Post subject: | Alternative checkboxes and radio's! |
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! |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |