View Full Version : Handle checkbox with pagination

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

<script type="text/javascript">
function storeValue(what) {
var myarray = new Array()
for(var i=0; i < document.generatereport.selected_companies_id_list.length; i++){
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


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.