Archive for the ‘Jquery Code’ Category


Exmaple --

<ul>

//data fetch with ajax //

<li value="delhi">Delhi</li>

<li value="noida">Noida</li>

<li value="newdelhi">New Delhi</li>

//data fetch with ajax //

</ul>

$("#filter_location").on('click', 'li', function() {

alert('ok');
});
Advertisements

<input type="checkbox" name="services[]" >Text 1<br>
<input type="checkbox" name="services[]" >Text 2<br>
<input type="checkbox" name="services[]" >Text 3<br>



$("#submitted").click(function() { 
 if( $('input[name="services[]"]:checked').length == 0 )
 {
    $('#services').prop('required',true); //for html5 ...add required attributes
 }
 else 
 {
    $('#services').prop('required',false);
 }
 });

update uniform.update() function for checbox checked…..

Looking at their docs, they have a $.uniform.update feature to refresh a “uniformed” element.

$(“input:checkbox”).uniform();

$("body").on("click", "#check1", function () {
    var two = $("#check2").attr("checked", this.checked);
    $.uniform.update(two);
});

you need to call $.uniform.update()