function sendValues() {
var str = $("#ryan_m").serialize();
var response = $('input[name=brand[]]:checked').val();
$.ajax({
url: "/trying1.php?avoidcache=' + myTimestamp();",
data: {str}
cache: false
});
}
<form action="trying1.php?b_id=$brand_id" method="get"/></td>
<input type="checkbox" name="brand[]" value="$brand_id"/>
<input type="submit" value="Compare" id="ryan_m" method="get" />
</form>
I am trying to use this Ajax request to execute upon checking the available check boxes. Currently, This script will do exactly what I want, but I have to hit submit for it to execute.
My question:
Is there a simple way that I can execute the ajax upon clicking the check box, without hitting submit?