Всем привет
Сделал скрипт который работает на Декстопах и не работает на мобильных
Подскажите что не так сделано?
HTML5 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| <div class="wrapper-content">
<p>
<span class="lcalc">Выберите акцию, для <a rel="nofollow" class="red-link" href="#sale" title="Узнать об условиях акций">получения скидки </a></span><br />
<select name="sale_sd" id="sale_sd" onchange="calc_user1();" class="icalc" required >
<option value="0">Выберите...</option>
<option value="nosale">Без акции</option>
<option value="repost">Сделай репост</option>
<option value="frend">Пригласи друга</option>
</select>
<span class="lcalc_2" id="user1_lebel" >Ваша анкета</span><br />
<input type="text" name="user1_fio" id="user1_fio" class="icalc_2" maxlength="20" placeholder="Ваше Имя и возраст" required />
<input type="text" name="user1_profile" id="user1_profile" class="icalc_2" maxlength="20" placeholder="Ваш профиль vk,fb,ok" required />
<input type="text" name="user1_phone" id="user1_phone" class="icalc_2" maxlength="13" placeholder="Ваш телефон 8(900)000-00-00" required />
<select name="sex_people1" id="sex_people1" onchange="calc_user1();" class="icalc" required >
<option value="0">Выберите ваш возраст и пол</option>
<option value="women_23-29">Девушка [23-29лет]</option>
<option value="women_30-32">Женщина [30-32года]</option>
<option value="women_33-42">Женщина [33-42года]</option>
<option value="women_43-52">Женщина [43-52года]</option>
<option value="men_23-32">Парeнь [23-32года]</option>
<option value="men_33-42">Мужчина [33-42года]</option>
<option value="men_43-52">Мужчина [43-52года]</option>
</select>
<div class="st-separator"></div><br />
<p>
<label class="lcalc_3">Полная стоимость билета:</label>
<label class="icalc_3" name="priceFull1" id="priceFull1">ХХХХ руб</label>
<label class="lcalc_3">Из них нужно оплатить сейчас:</label>
<label class="icalc_3" name="priceOne1" id="priceOne1">ХХХХ руб</label>
</p>
</p>
<p>
<a rel="nofollow" href="#" onclick="oplataNull();" class="btn-red-2" id="next_go" title="Оплатить билет по реквизитам">ОПЛАТИТЬ > </a>
</p>
</div> |
|
Cам скрипт
Javascript |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| function calc_user1() { /*Вызывается onchange при изменение select*/
let v1 = document.getElementById("sex_people1").value,
v2 = document.getElementById("sale_sd").value,
priceFullText = 'ХХХХ руб',
priceOneText = 'ХХХХ руб';
if (v1 === 'women_23-29'){
if (v2 === "nosale") {
priceFullText = "700 рублей";
priceOneText = "500 рублей";
}
if (v2 === "repost") {
priceFullText = "600 рублей";
priceOneText = "500 рублей";
}
if (v2 === "frend") {
priceFullText = "550 рублей";
priceOneText = "500 рублей";
}
}
document.getElementById('priceFull1').innerText = priceFullText;
document.getElementById('priceOne1').innerText = priceOneText;
document.getElementById('priceFull3').innerText = priceFullText;
document.getElementById('priceOne3').innerText = priceOneText;
}
function oplataNull() { /*Вызывается onclick*/
if (document.getElementById('user1_profile').value == "" ||
document.getElementById('user1_fio').value == "" ||
document.getElementById('user1_phone').value == "" ||
document.getElementById('sex_people1').value == 0)
{
alert ( "Пожалуйста заполните все поля выделенные красным цветом." );
document.getElementById('next_go').href = "#";
}
else
{
document.getElementById('next_go').href = "#order";
}
} |
|
Есть подозрения что всему вина действий onClick, onChange которые в HTML 5 на Андроиде и иОС не работают
Подскажите, как переделать скрипт чтоб он работал на всех устройствах?