Search hide instead of remove

Search hide instead of remove

BRKLBRKL Posts: 3Questions: 1Answers: 0

Hello,

I am using a table in my form, however when i post that form only the displayed options are posted, not the rest, is it possible for Datatables to hide the elements, instead of removing them from the DOM?

Thanks in advance!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @BRKL ,

    We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • BRKLBRKL Posts: 3Questions: 1Answers: 0
    edited June 2018

    Hi Colin, unfortunately i can't link the page we're working on, but I have attached a test case as index.php. You can run it using

    php -S localhost:8000
    

    and test it.

    We are using it to add accounts to a group. So say i want to add account 1, 16 and 24 to a group, i'd search for them, tick them and submit the form. However only the accounts that are on the page are sent to the server, because the rest are removed from the dom, i assume.

    I hope there is a solution for this, thanks in advance for any help!

    EDIT: forgot to attach the file :#

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @BRKL ,

    Ah I see, that was an interesting way to get an example, it works well. Take a look at this example here, this shows how to use serialize() to get what you want. Also, @gyrocode gave some examples on how to tackle this on his website - take a look at his page here ,

    Hope that helps,

    Cheers,

    Colin

  • BRKLBRKL Posts: 3Questions: 1Answers: 0

    Hi Colin,

    Thanks a lot, that really helped!

This discussion has been closed.