jquery - See if bootstrap checkbox is checked asp.net c# -


i need true or false if bootstrap check-box checked on server side

this control:

<div id="checkcategoria" runat="server" class="btn-group" data-toggle="buttons-checkbox" runat="server">     <asp:button id="chkinspecao" onclientclick="return false;" text="inspeção" usesubmitbehavior="false" runat="server" cssclass="btn btn-check" />     <asp:button id="chkhipot" onclientclick="return false;" text="hipot" usesubmitbehavior="false" runat="server" cssclass="btn btn-check" />     <asp:button id="chkcalibracao" onclientclick="return false;" text="calibração" usesubmitbehavior="false" runat="server" cssclass="btn btn-check" />     <asp:button id="chkchecageminterna" onclientclick="return false;" text="checagem interna" usesubmitbehavior="false" runat="server" cssclass="btn btn-check" />     <asp:button id="chkrevisao" onclientclick="return false;" text="revisão" usesubmitbehavior="false" runat="server" cssclass="btn btn-check" /> </div> 

as have runnat="sever", can them on server-side how can see if it's toggled or not?

i tried:

string inspecao = chkinspecao.attributes["checked"]; 

but it's returning null.

how can that?

you can make beautiful checkboxes jquery, please check page: chackbox ui jquery


anyway, how:

 <script  type="text/javascript">     $(function () {         $(".btn").click(function () {              //the old selected gets unselected             $(".selected").addclass("nomore");              //this won't              $(this).removeclass("nomore");              //because 1 selected             $(this).addclass("selected");              //take tab selected             $("#valsel").val($(this).attr("id"));             return false;         });     }); </ script> <asp:hiddenfield id="valsel" clientidmode="static" runat="server" /> 

then, code-behind:

label1.text = valsel.value; 

this style used (but not important):

<style> .selected {     color:green; } .nomore {     color:red; } </ style> 

i imagine change background color, insist, can use checkboxes jquery ui.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -