Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uncheck and hide

Status
Not open for further replies.

nuttyernurse

Technical User
May 18, 2009
35
US
Hello all!

I am a complete noob, and I will try to explain what I am trying to accomplish. I have several modifiers for diets, and only some of them pertain to the main diet. I would like to make sure the box that is to be hidden is unchecked and then hidden, the code below works, but I was wondering if there was a more elegant solution. This is just a sample, there are 28 modifiers per diet. There is a URL to the file.

function disableregular() {
document.getElementById("cb_calcium_mod").checked=false
document.getElementById("calcium_mod").style.display = 'none'
document.getElementById("cb_cardiac_mod").checked=false
document.getElementById("cardiac_mod").style.display = 'none'
document.getElementById("cb_cho_mod").checked=true
document.getElementById("cb_cho_mod").style.display ='
}

Thank you for helping me out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top