kindly help me.
I need like this "http://something/somthing?word=one,two&number=5,7"
but i have a code for this which is like "http://something/somthing?word=two&word=one&number=5&number=7"
<div class="panel-body">
<div class="rowElem">
checkbox name_1 1 <input type="checkbox" value='one' name="word" />
checkbox name_1 2 <input type="checkbox" value='two' name="word" />
checkbox name_1 3 <input type="checkbox" value='three' name="word" />
<br><br>
checkbox name_2 1 <input type="checkbox" value='1' name="number" />
checkbox name_2 2 <input type="checkbox" value='2' name="number" />
checkbox name_2 3 <input type="checkbox" value='3' name="number" />
<br><br>
<p>
</p>
</div></div>
jQuery("input:checkbox").change(function () {
if ($('input:checkbox').is(':checked')) {
var data = [],
loc = $('<a>', { href: window.location })[0];
if (window.location.href.indexOf(this.name) > -1) {
alert(this.name);
}
$('input[type="checkbox"]').each(function (i) {
if (this.checked) {
data.push(this.name + '=' + this.value);
}
});
data = data.join('&');
$('p').html(loc.pathname + '?' + data);
}
});
you can try this in jsfiddle.net with jQuery1.10.1