D
D
danyfir2018-07-18 17:50:25
JavaScript
danyfir, 2018-07-18 17:50:25

How to change data dynamically in loaded script?

Hello! There is a script from the payment integrator "paymaster" that loads the payment form:

<script id="paymaster" type='text/javascript' src='https://paymaster.ru/ru-RU/widget/Basic/1?LMI_MERCHANT_ID=1111&LMI_PAYMENT_AMOUNT=100&'></script>

There is also a form, depending on which the payment amount changes (LMI_PAYMENT_AMOUNT)
<form>
 <select name="mesto">
<option value="Победитель (1 место)">1 место</option>
<option value="Победитель (2 место)">2 место</option>
<option value="Победитель (3 место)">3 место</option>
<option value="Участник">Участник</option>
</select>
<input type="submit" value="Оплатить">
</form>

But since paymaster has a script, then it is actually loaded when the page is loaded and it is somehow impossible to change the value dynamically.
There was an idea to load the script after pressing submit. I just don't understand how to implement it. Tell me please!
Conditional:
if clicked submit {
load script paymaster
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question