...

View Full Version : Handle checkbox with pagination



laspal
12-09-2008, 11:09 AM
Hi,
here is my code:
<form name="generatereport" method="POST" action="">
<table id="companieslisting">
{% for companies in companylist.object_list %}
<tr>
<td><input type="CHECKBOX" id="" name="selected_companies_id_list" value="{{companies.id}}" onchange='storeValue(this)' /></td> </tr>
{% endfor %}
</table>
<input type="submit" value="Generate Report" name="Send" class="add-company-submit"/ >
</form>

<script type="text/javascript">
function storeValue(what) {
var myarray = new Array()
for(var i=0; i < document.generatereport.selected_companies_id_list.length; i++){
if(document.generatereport.selected_companies_id_list[i].checked){
myarray[i] = document.generatereport.selected_companies_id_list[i].value}
}

What I want is to get the list of selected checkbox. Right now I am getting the list of selected checkbox for that page.
I mean I am using pagination so the list which I am getting is for that particular page.

How can I solve this problems

Thanks.

abduraooft
12-09-2008, 11:59 AM
Post your parsed html code taken from browsers view source option. Please use
tags to wrap your code while posting here.

PS: validate your markup (http://validator.w3.org/#validate_by_input) while development.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum