add same id as value and name now it pops up because of app.js but does override somehow

This commit is contained in:
Ivan Hörler 2018-01-15 00:07:14 +01:00
parent 2a1a565f90
commit fce2f77cb2
3 changed files with 7 additions and 6 deletions

View File

@ -16,7 +16,7 @@ def currency_update(request):
print('its get method')
else:
print('its not get method')
currency = request.GET.get('currency', None)
currency = request.GET.get('currency_update', None)
data = ExchangeRate.objects.filter(
name__name=currency).values(
'exchange_rate_to_chf').latest(

View File

@ -1,15 +1,13 @@
$("#currency_update").change(function () {
var currency = $(this).val();
var currency_update = $(this).val();
$.ajax({
url: '/ajax/currency_update/',
data: {
'currency': currency
'currency_update': currency_update
},
dataType: 'json',
success: function (data) {
if (data.is_taken) {
alert("es pop auf! --dies kommt von: static/js/app.js--.");
}
alert("es pop auf! --dies kommt von: static/js/app.js--.", data);
}
});
});

View File

@ -28,6 +28,9 @@
<option value="GBP">GBP</option>
<option value="JPY">JPY</option>
</select>
<ul class="nav navbar-nav">
{{ form.as_li }}
</ul>
</form>
</div>
</div>