Jump to content

[SOLVED] 1 select per element


Ninjakreborn

Recommended Posts

you can write a javascript function such as

function swapColDel()
{
if (document.getElementById("col").checked == true)
{
   document.getElementById("del").checked = false   }
if (document.getElementById("del").checked == true)
{
   document.getElementById("col").checked = false   }
} 

 

you will need to modify that code for your check boxes but basically what happens is in the onlclick of each checkbox this function is run and if one is selected the other one is deselected

There is a better "suggested" solution then using display as the display property removes the element from the document flow completely.

use visibility.

document.getElementById("id").style.visibility

It will not remove the element completely but just will make it invisible.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.