-
-
Save renjithsraj/110d134bb3c07dfa52911b5e14ed9373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#your-dropdown-id").change(function(){ | |
var drid = $(this).val(); | |
$.ajax({ | |
url: 'getUsers.php', | |
type: 'post', | |
data: {value:drid}, | |
dataType: 'json', | |
success:function(response){ | |
// add the json response into html values | |
} | |
} | |
}); | |
}); | |
}); | |
@csrf_exaampt | |
def ajax_view(): | |
response = {} | |
if request.POST and request.is_ajax(): | |
print (request.POST) | |
# get the value from post | |
# make json value | |
return HttpResponse(json.dumps(response)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment