Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Actually in my project i am having two check boxes (CheckBox1,CheckBox2). what i need to achieve is if i checked the checkbox1 means checkbox2 should be disappear. if i uncheck means it should be visible . same thing it should hapend to checkbox2 if i check checkbox2 means checkbox should disappear and if i uncheck means it should visible. this type of functionality can i achieve through javascript in asp.net
Posted
Comments
Thanks7872 7-Aug-14 1:50am    
And have you tried even once in Google to search for the same?
ntitish 7-Aug-14 3:05am    
Yes i tried and i got an idea so that i am waiting for the best answer do u have any problem....
Thanks7872 7-Aug-14 3:07am    
Tried what? And which idea are you talking about? And yes, i have problem with this question as we don't help some one who don't show us the code, point out the issue and ask specific question.
ntitish 7-Aug-14 7:26am    
i posted my answer below just watch it. first off all learn the manners no one will ask the question with out go ogling. after searching in the google only they will get some idea and they will ask for the best solution so if u know the answer just guide us other wise just keep calm k. (meru emana thopulu anukuntunara thelistha chapandi leka potha noru musukuni kurchondi meru me egastralu vachina vadu kuda intha buldup kotadu)
Thanks7872 7-Aug-14 7:45am    
Don't be abusive or it may lead you to account cancellation.

Further, you found the answer yourself right? That is what i suggested that try something and you will definitely get some answer.

 
Share this answer
 
C#
var chkStatus1 = document.getElementById("chkbutton1");
var chkStatus2 = document.getElementById("chkbutton2");

if (chkStatus1.checked) {
    // do your implementation for if part
}
else if(chkStatus2.checked)
{
   // do your implementation for else if part for checkbox2
}
else if(chkStatus2.checked && chkStatus2.checked)
{
   // do your implementation when two chechbox status is checked.
}
else
{
   // do your implementation for else part.
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900