It is currently Thu Mar 28, 2024 2:04 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post Post subject: Alternative checkboxes and radio's!
 
Offline
Godlike Poster
Godlike Poster
Years of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membershipYears of membership
User avatar

Joined: Sun Oct 16, 2005 9:42 am
Posts: 8798
Karma: 17

Location: Imagine in your mind a posh country club
Steam Login Name: azcn2503
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!

_________________
Follow your heart and live the dream <3


Wed Apr 26, 2006 3:27 pm 
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Karma functions powered by Karma MOD © 2007, 2009 m157y