Есть форма для расчета стоимости страховки на сайте, полностью на JS.
Заказчик говорит, что она подтягивается с другого сайта.
Все что есть - вот этот код:
var divForm = document.getElementById('form_osago_elmark');
divForm.innerHTML = `
<form action="" id="form-osago" method="post">
<div class="level one ">
<div class="step_1">
<span class="title-dir">Введите данные о своем транспортном средстве <span class="warn"> (все поля обязательны для заполнения)</span></span>
<select name="vehicle_type" class="line_block">
<option >Категория ТС</option>
<option value="B" selected>B</option>
</select>
<input type="text" name="vehicle_mark" id="mark_auto" class="line_block" placeholder="Марка ТС" value="" required/> <input type="text" name="vehicle_model" id="model_auto" class="line_block" placeholder="Модель" value="" required/> <input type="text" name="vehicle_year" id="year" class="line_block" placeholder="Год выпуска" value="" required/> <input type="number" name="vehicle_power" id="power" class="line_block" placeholder="Мощность, л.с." value="" required/>
<div class="list-model"> </div>
<div class="both"></div>
<label class="lab_vehicle_number"><input name="with_trailer" type="checkbox"/>Используется с прицепом</label>
<div class="both"></div>
<div class="id-ts">
<span class="hText">Идентификатор ТС</span>
<div class="vin">
<label class="auto-number"><input type="radio" name="vehicle_id" checked="" value="vin"> VIN</label> <label class="auto-number"><input type="radio" name="vehicle_id" value="body_number"> Номер кузова</label> <label class="auto-number"><input type="radio" name="vehicle_id" value="chassis_number"> Номер шасси </label>
<div class="both"></div>
<input type="text" name="vehicle_id_number" id="VIN" maxlength="17" class="auto-number-input" value="" placeholder="VIN" required="">
</div>
</div>
<div class="gos-number"> <span class="hText">Гос.номер ТС</span> <input type="text" name="vehicle_number" id="gos-number" placeholder="Введите гос.номер" value="" required=""> <label class="lab_vehicle_number"><input type="checkbox" class="no-number" name="no_vehicle_number" value=""> У меня еще нет номера</label> </div>
<div class="region"> <span class="hText">Регион</span> <input type="text" name="vehicle_region" maxlength="3" id="region" value="" placeholder="Введите регион" required=""> </div>
<div class="both"></div>
<div class="docTS">
<span class="hText">Документ ТС</span> <label class="auto-number"><input type="radio" name="vehicle_document" checked="" value="STS"> СТС</label> <label class="auto-number"><input type="radio" name="vehicle_document" value="PTS"> ПТС</label>
<div class="both"></div>
<input type="text" id="serial-spts" name="vehicle_document_number" value="" placeholder="Серия, номер"> <input type="text" id="date-spts" name="vehicle_document_date" value="" placeholder="Когда выдан*">
</div>
<div class="dCard"> <span class="hText">Диагностическая карта</span> <input type="number" name="diag_card_number" id="number_diagnost_card" value="" placeholder="Введите номер диагностической карты" required=""> <input type="text" name="diag_card_to_date" value="" id="date-card" placeholder="Действительна до"> </div>
<div class="both"></div>
<div class="buttonList">
<span class="button nextOne">Далее</span>
<div class="both"></div>
</div>
<div class="both"></div>
</div>
</div>
<div class="level two">
<div class="step_2">
<div class="other-owner">
<div class="col-lg-6"> <span class="hText">Введите данные о страхователе</span>
<input type="text" name="insurer_last_name" id="insur-name" class="line_block" placeholder="Фамилия" value="">
<input type="text" name="insurer_first_name" id="insur-first-name" class="line_block" placeholder="Имя" value=""><br>
<input type="text" name="insurer_passport_data" id="serial-passport" class="line_block" value="" placeholder="Серия и номер паспорта">
<input type="text" name="insurer_passport_date" id="date-pasport" class="line_block" value="" placeholder="Когда выдан"> <br>
<input type="text" name="insurer_driver_license_number" value="" class="serial-passport ser-pas" placeholder="Номер и серия ВУ"/>
<input type="text" name="insurer_driver_license_date" class="line_block" id="driver_date_begin" placeholder="Дата выдачи ВУ"/>
</div>
<div class="col-lg-6"> <span class="hText"> </span> <input type="text" name="insurer_middle_name" id="insur-middle-name" class="line_block" placeholder="Отчество" value=""> <input type="text" name="insurer_birth_date" id="date-card" class="line_block date-card" value="" placeholder="Дата рождения"><br><input type="text" name="insurer_full_address" class="line_block" id="one-add" value="" placeholder="Адрес регистрации" autocomplete="off"> <input type="text" name="insurer_driver_date_begin" id="driver_date_begin" value="" placeholder="Дата выдачи первого ВУ"> </div>
<div class="both"></div>
</div>
<div class="col-lg-6">
<span class="hText">Собственник</span> <label class="auto-owner"><input type="radio" id="insurer" name="owner" checked="" value="insurer">Совпадает со страхователем</label> <label class="auto-owner"><input type="radio" id="another" name="owner" value="another"> Другой</label>
<div class="other-owner-two"> </div>
</div>
<div class="col-lg-6">
<span class="hText">Водители</span> <label class="auto-owner"><input type="radio" id="unlimited" checked="" name="drivers" value="unlimited">Неограниченное количество</label> <label class="auto-owner"><input type="radio" id="limited" name="drivers" value="limited"> 1 и более</label>
<div class="drivers"> <span class="button addDriver">+ Добавить водителя</span> </div>
</div>
<div class="both"></div>
<div class="driverInsurance"> </div>
<div class="buttonList">
<span class="button nextTwo">Далее</span> <span class="button prevOne">Назад</span>
<div class="both"></div>
</div>
</div>
</div>
<div class="level three">
<span class="hText">Сведения о полисе </span>
<div class="col-lg-4"> <input type="text" id="day-inssue" name="policy_from_date" value="" placeholder="Дата начала действия полиса"> <br><span class="prav"></span> </div>
<div class="col-lg-4"> <input type="text" id="number-agent" name="agent_phone" value="" placeholder="Ваш телефон"> </div>
<div class="col-lg-4"> <input type="email" value="" name="agent_email" id="mail_agent" placeholder="Ваш E-mail"> </div>
<div class="both"></div>
<span class="button" id="payment">Рассчитать</span>
<div class="errorPayment"> </div>
<div class="payment">
<div class="tablePayment"></div>
</div>
<span class="button prevTwo">Назад</span>
</div>
<div class="level four"></div>
<input type="hidden" name="contract_id" id="contract_id" value="">
</form>
`
var body = document.body;
var linkArrayCss = [
'https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css',
'https://form.osago24.org/js/libs/bootstrap/bootstrap-grid-3.3.1.min.css',
'https://form.osago24.org/css/style.css?78312125',
'https://fonts.googleapis.com/css?family=Ubuntu'
];
var linkArrayJS = [
'https://form.osago24.org/js/jquery-1.12.4.js',
'https://form.osago24.org/js/jquery-ui.js',
'https://form.osago24.org/js/jquery.maskedinput.min.js',
'https://momentjs.com/downloads/moment.js',
'https://ahunter.ru/js/min/ahunter_suggest.js',
'https://form.osago24.org/js/script.js?7812125'
];
for (var io = 0; io < linkArrayJS.length; io++) {
var jsLink = document.createElement("script");
jsLink.src = linkArrayJS[io];
jsLink.async = false;
body.insertBefore(jsLink, body.firstChild);
}
for (var i = linkArrayCss.length-1; i >= 0 ; i--) {
var cssLink = document.createElement('link');
cssLink.href = linkArrayCss[i];
cssLink.rel = 'stylesheet';
body.insertBefore(cssLink, body.firstChild);
}
}
window.onload = init;
А надо переписать стили. Вопрос: как?