checkbox validation using jquery
i'm searching a while for this and i can't found something that works for me.

i have this checkbox:

     <%= Html.CheckBox("cbCodigo") %> <label class="inline" for="Codigo">Codigo</label>
     <%= Html.CheckBox("cbNombreCliente") %> <label class="inline" for="NombreCliente">Nombre del cliente</label>
     <%= Html.CheckBox("cbCiudad") %> <label class="inline" for="Ciudad">Ciudad</label>

i want to validate that only one is checked when  a textbox change, something like this, and use .validate of jquery, i don't what is the best way for validate this.

tbCodCliente is a textbox that i use as a search parameter, and the checkbox is a parameter or a value for tha autocomplete function of the textbox

    $('#tbCodCliente').change(function() {
    	 if ($('#cbCodigo').attr('checked', false) &&
    	      $('#cbNombreCliente').attr('checked', false) &&
    	      $('#tbCheckbox').attr('checked', false)) {
    	                
    	      // fuction for validate method          
    	 }
    });

i trying to validate of this way, but i don't know if it is the best way.

i'm handling that just one checkbox is checked with this functions.

    $('#cbCodigo').change(function() {
    	if ($(this).is(':checked')) {
    	    $('#cbNombreCliente').prop("checked", false);
    	    $('#cbCiudad').prop("checked", false);
    	    $('#tbCheckbox').val("CDCLI");
        }
    });
    
    $('#cbNombreCliente').change(function() {
    	if ($(this).is(':checked')) {
    	    $('#cbCodigo').prop("checked", false);
    	    $('#cbCiudad').prop("checked", false);
    	    $('#tbCheckbox').val("RASCL");
        }
    });
    
    $('#cbCiudad').change(function() {
    	if ($(this).is(':checked')) {
    	    $('#cbCodigo').prop("checked", false);
    	    $('#cbNombreCliente').prop("checked", false);
    	    $('#tbCheckbox').val("LOCCL");
    	}
    });
checkbox validation using jquery
===

i'm searching a while for this and i can't found something that works for me.

i have this checkbox:

     <%= Html.CheckBox("cbCodigo") %> <label class="inline" for="Codigo">Codigo</label>
     <%= Html.CheckBox("cbNombreCliente") %> <label class="inline" for="NombreCliente">Nombre del cliente</label>
     <%= Html.CheckBox("cbCiudad") %> <label class="inline" for="Ciudad">Ciudad</label>

i want to validate that only one is checked when  a textbox change, something like this, and use .validate of jquery, i don't what is the best way for validate this.

tbCodCliente is a textbox that i use as a search parameter, and the checkbox is a parameter or a value for tha autocomplete function of the textbox

    $('#tbCodCliente').change(function() {
    	 if ($('#cbCodigo').attr('checked', false) &&
    	      $('#cbNombreCliente').attr('checked', false) &&
    	      $('#tbCheckbox').attr('checked', false)) {
    	                
    	      // fuction for validate method          
    	 }
    });

i trying to validate of this way, but i don't know if it is the best way.

i'm handling that just one checkbox is checked with this functions.

    $('#cbCodigo').change(function() {
    	if ($(this).is(':checked')) {
    	    $('#cbNombreCliente').prop("checked", false);
    	    $('#cbCiudad').prop("checked", false);
    	    $('#tbCheckbox').val("CDCLI");
        }
    });
    
    $('#cbNombreCliente').change(function() {
    	if ($(this).is(':checked')) {
    	    $('#cbCodigo').prop("checked", false);
    	    $('#cbCiudad').prop("checked", false);
    	    $('#tbCheckbox').val("RASCL");
        }
    });
    
    $('#cbCiudad').change(function() {
    	if ($(this).is(':checked')) {
    	    $('#cbCodigo').prop("checked", false);
    	    $('#cbNombreCliente').prop("checked", false);
    	    $('#tbCheckbox').val("LOCCL");
    	}
    });