Wednesday, July 3, 2013

calculate total value of checkboxes using jquery

If one checkbox is selected, it will add the values of checkboxes automatically. If you will click unchecked, the total will be updated automatically.
JQUERY
$(document).ready(function() {
$("input[type=checkbox]").change(function(){
  recalculate();
});
function recalculate(){
    var sum = 0;
    $("input[type=checkbox]:checked").each(function(){
      sum += parseInt($(this).attr("rel"));
    });
  //  alert(sum);
$("#output").html(sum);
}
});
HTML
<div id="school">
    <p><input type="checkbox" rel="15">Book</p>
    <p><input type="checkbox" rel="15">Bag</p>
    <p><input type="checkbox" rel="15">Notebook</p>
</div>

<span id="output"></span>

Ref: http://stackoverflow.com/questions/5066537/calculate-total-value-checkboxes-jquery

Monday, July 1, 2013

How to fix Error 324 (net::ERR_EMPTY_RESPONSE) in Codeigniter

As many different factors cause Error 324 (net::ERR_EMPTY_RESPONSE), there is no one answer for everyone. Here is my problem and how I fixed the Error 324.
Problem Description:
I downloaded a fresh copy of Codeigniter Version 2.1.3 and try to access welcome message page but I keep getting Error 324 ERR_EMPTY_RESPONSE in my browser (chrome) and in the other browsers i got blank (white screen) page." 

Solution:
I cleared the cache from browser. And I restarted the MAMP server. And it worked like charm in all browsers. :) 

Hope this will help you as well.