How do I send this display_false()
function to the server with jQuery so that the database is updated without refreshing the page?
def display_f
You'll need an AJAX call, something like this after including your jQuery libraries.
$(document).ready(function() {
//false click action
$("a.false").click(function () {
//ajax server call
$.ajax({
url: '/useradminpage?main_id=%s&display=false',
success: function(data) {
//do some stuff.
alert('returned');
}
});
});
});
You cannot update a server database with JQuery. All you can do is send a request that is handled by the server.
Use JQuery.Ajax or any spin-offs of that function to send the request. To your server it will look as a regular request.