how do i update/populate my select input after insert data without refresh page?
how do i update/populate my select input after insert data without refresh page?

Hello,
how do i update/populate my select input after insert data without refresh page?
Thanks
This discussion has been closed.
Replies
Please provide more details of what you are doing.
How are you inserting data?
Where are the selects and what are they used for?
Maybe you can post a link to your page or a test case so we can see exactly what you are doing.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi Kevin,
Sorry, i had to create another free webhost
https://kennelz.000webhostapp.com/pets.php
Your link says "502 Bad Gateway".
Aww, not possible, im online now and website working fine
Hi @EricD ,
This blog post may help, as it's showing how the table can be updated before an edit. The same logic could apply to your scenario.
Cheers,
Colin
Thanks for reply, i ended up with this solution, idk if a good idea, because i have to reload ajax all time
success: function () {
$("#pets").DataTable().ajax.reload(null, false );
}
Now i want to order by 'name', how do i do it, since we dont have [->order] in server side
https://kennelz.000webhostapp.com/dogs.php
if you get 502 badgateway, can you check with another browser please
Thank you
Hi @EricD ,
If the data is likely to change, you would need to request from the server each time, as in the example I linked to before. If it's static, you could just do when the table initialises.
Cheers,
Colin