Answer the question
In order to leave comments, you need to log in
How to make a function call in Internet Explorer?
Here's the code. Works everywhere except IE. The site has many visitors from this browser. Judging by the console, IE does not even understand that the Selected(this) function is being called. Maybe this doesn't read?
<script>
function Selected(a) {
var label = a.value;
if (label=='Победитель (1 место)') {
document.getElementById('Block').innerHTML = 'Стоимость диплома: 120 руб.';
document.querySelectorAll('#cena').forEach((el) => el.value = '120');
}
else if (label=='Победитель (2 место)') {
document.getElementById('Block').innerHTML = 'Стоимость диплома: 110 руб.';
document.querySelectorAll('#cena').forEach((el) => el.value = '110');
}
else if (label=='Победитель (3 место)') {
document.getElementById('Block').innerHTML = 'Стоимость диплома: 100 руб.';
document.querySelectorAll('#cena').forEach((el) => el.value = '100');
}
else if (label=='Участник') {
document.getElementById('Block').innerHTML = 'Стоимость диплома: 29 руб.';
document.querySelectorAll('#cena').forEach((el) => el.value = '29');
alert('Участник');
}
}
</script>
<select required name="user_status" id="user_status" onChange="Selected(this)">
<option class="cvet" value="" disabled="" selected="">Место</option>
<option value="Победитель (1 место)">1 место (120 руб.)</option>
<option value="Победитель (2 место)">2 место (110 руб.)</option>
<option value="Победитель (3 место)">3 место (100 руб.)</option>
<option value="Участник">Участник (29 руб.)</option>
</select>
<div id='Block'>Стоимость диплома: 29 руб.</div>
<form method="POST" class="application" accept-charset="UTF-8" action="https://paymaster.ru/payment/init">
<input type="hidden" name="LMI_MERCHANT_ID" value="klm32klm-23lmk23klm"/>
<input type="hidden" id="cena" name="LMI_PAYMENT_AMOUNT" value="100" />
<input type="hidden" name="LMI_CURRENCY" value="RUB" />
<input type="hidden" name="LMI_PAYMENT_METHOD" value="BankCard" />
<input type="submit" value="Оплатить">
</form>
Answer the question
In order to leave comments, you need to log in
If you don't use faucets but paste the code directly into the page, then it doesn't work because IE doesn't support arrow functions .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question