0.0.31 forms

This commit is contained in:
SBD
2025-01-15 18:04:57 +03:00
parent 33239e3c90
commit 74742c3e8e
3 changed files with 13 additions and 2 deletions

View File

@@ -117,4 +117,15 @@ function dataToFormData(data) {
formData.append(key, data[key]);
}
return formData;
}
function selectInputWContainer (el, callback) {
if (!el) return;
let $field = el.closest('.field_container');
if (!$field) return;
let $input = $field.querySelector('input');
$input.focus()
if (callback) callback(el);
}

View File

@@ -1,7 +1,7 @@
{% load static %}
{% load i18n %}
<div class="w_daterangepicker">
<div class="w_daterangepicker" onclick="selectInputWContainer(this)">
<div class="date_range_input_cont">
<input class="dropped" type="text" name="{{ name }}" id="id_{{ name }}" autocomplete="off"{% if initial %} value="{{ initial|date:'d.m.Y' }}"{% endif %}>
<img onclick="clickOnDateIconE(this)" src="{% static "v2/icons/widgets/w_datarangepicker/datarangepicker_icon.svg" %}" alt="">

View File

@@ -2,7 +2,7 @@
{% load i18n %}
<div class="w_select_country closed">
<div class="w_select_country_header" onclick="openCountruSelectIfDataEnter(this)">
<div class="w_select_country_header" onclick="selectInputWContainer(this, openCountruSelectIfDataEnter)">
<div class="select_country_header_left_part">
<div class="container_inf_about_country">
<img class="country_flag_img_container"{% if initial.country.flag %} src="{{ initial.country.flag.url }}"{% endif %}>