Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Handle checkbox with pagination

    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.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Post your parsed html code taken from browsers view source option. Please use [code][/code] tags to wrap your code while posting here.

    PS: validate your markup while development.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •