0.0.51
revert autocomlete
This commit is contained in:
@@ -64,8 +64,6 @@ function insertSearchList(data, ctrl_name) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showSearchList() {
|
||||
let input_list = document.getElementsByClassName('input_list');
|
||||
if(input_list.classList.contains('show')){
|
||||
@@ -74,30 +72,15 @@ function showSearchList() {
|
||||
|
||||
}
|
||||
|
||||
// function onblurInputField(event,el){
|
||||
//
|
||||
// // if(el.classList.contains("from_country_container")){
|
||||
// let search_list = document.getElementsByName(el.name + '_list')[0];
|
||||
// let parent_event = $(event.explicitOriginalTarget).parents('.input_list' );
|
||||
// if(!parent_event || parent_event[0] !== search_list){
|
||||
//
|
||||
// search_list.classList.remove('show')
|
||||
// }
|
||||
//
|
||||
// // }
|
||||
// }
|
||||
// function onblurInputField(el){
|
||||
//
|
||||
// // if(el.classList.contains("from_country_container")){
|
||||
// let search_list = document.getElementsByName(el.name + '_list')[0];
|
||||
// // let parent_event = $(event.explicitOriginalTarget).parents('.input_list' );
|
||||
// // if(!parent_event || parent_event[0] !== search_list){
|
||||
// //
|
||||
// // search_list.classList.remove('show')
|
||||
// // }
|
||||
// if(search_list.classList.contains('show')){
|
||||
// search_list.classList.remove('show')
|
||||
// }
|
||||
//
|
||||
// // }
|
||||
// }
|
||||
function onblurInputField(event,el){
|
||||
|
||||
// if(el.classList.contains("from_country_container")){
|
||||
let search_list = document.getElementsByName(el.name + '_list')[0];
|
||||
let parent_event = $(event.explicitOriginalTarget).parents('.input_list' );
|
||||
if(!parent_event || parent_event[0] !== search_list){
|
||||
|
||||
search_list.classList.remove('show')
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
@@ -55,6 +55,58 @@
|
||||
{% if form.fields.arrival_DT.required %} required{% endif %}
|
||||
id="id_arrival_DT"
|
||||
{% if form.data.arrival_DT %}value="{{ form.data.arrival_DT }}"{% endif %}
|
||||
{# |date: 'Y-m-d H:i' #}
|
||||
/>
|
||||
{% if form.errors and form.errors.arrival_DT %}
|
||||
<span>{{ form.errors.arrival_DT }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="from_to_country">
|
||||
<div class="from_country_container">
|
||||
<label for="id_from_address_point">{{ form.fields.from_address_point.label }}</label>
|
||||
<input type="number" name="from_address_point" id="id_from_address_point" hidden />
|
||||
<input
|
||||
oninput="searchTown(this)"
|
||||
onclick="searchTown(this)"
|
||||
onblur="onblurInputField(event, this)"
|
||||
type="text"
|
||||
name="from_address_point_txt"
|
||||
{% if form.fields.from_address_point.required %} required{% endif %}
|
||||
id="id_from_address_point_txt"
|
||||
{% if form.cleaned_data.from_address_point_txt %}value="{{ form.cleaned_data.from_address_point_txt }}"{% endif %}
|
||||
/>
|
||||
<div class="input_list" name="from_address_point_txt_list">
|
||||
</div>
|
||||
{% if form.errors and form.errors.from_address_point %}
|
||||
<span>{{ form.errors.from_address_point}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<label for="id_to_address_point">{{ form.fields.to_address_point.label }}</label>
|
||||
<input type="number" name="to_address_point" id="id_to_address_point" hidden />
|
||||
<input
|
||||
oninput="searchTown(this)"
|
||||
onclick="searchTown(this)"
|
||||
onblur="onblurInputField(event, this)"
|
||||
type="text"
|
||||
name="to_address_point_txt"
|
||||
{% if form.fields.to_address_point.required %} required{% endif %}
|
||||
id="id_to_address_point_txt"
|
||||
{% if form.cleaned_data.to_address_point_txt %}value="{{ form.cleaned_data.to_address_point_txt}}"{% endif %}
|
||||
{% if form.errors and form.errors.departure_DT %}
|
||||
<span>{{ form.errors.departure_DT }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<label for="id_arrival_DT">{{ form.fields.arrival_DT.label }}</label>
|
||||
<input
|
||||
type="datetime-local"
|
||||
name="arrival_DT"
|
||||
{% if form.fields.arrival_DT.required %} required{% endif %}
|
||||
id="id_arrival_DT"
|
||||
{% if form.data.arrival_DT %}value="{{ form.data.arrival_DT }}"{% endif %}
|
||||
{# |date: 'Y-m-d H:i' #}
|
||||
/>
|
||||
{% if form.errors and form.errors.arrival_DT %}
|
||||
@@ -70,18 +122,13 @@
|
||||
<input
|
||||
oninput="searchTown(this)"
|
||||
{# onclick="showSearchList()"#}
|
||||
{# onblur="onblurInputField(this)"#}
|
||||
onblur="onblurInputField(event, this)"
|
||||
type="text"
|
||||
list="from_address_point"
|
||||
name="from_address_point_txt"
|
||||
{% if form.fields.from_address_point.required %} required{% endif %}
|
||||
id="id_from_address_point_txt"
|
||||
{% if form.cleaned_data.from_address_point_txt %}value="{{ form.cleaned_data.from_address_point_txt }}"{% endif %}
|
||||
/>
|
||||
<datalist id="from_address_point">
|
||||
|
||||
</datalist>
|
||||
|
||||
<div class="input_list" name="from_address_point_txt_list">
|
||||
</div>
|
||||
{% if form.errors and form.errors.from_address_point %}
|
||||
@@ -110,14 +157,14 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{# <div>#}
|
||||
{# <label for="id_from_city">{{ form.fields.from_city.label }}</label>#}
|
||||
{# <input type="text" name="from_city"{% if form.fields.from_city.required %} required{% endif %} id="id_from_city">#}
|
||||
{# </div>#}
|
||||
{# <div>#}
|
||||
{# <label for="id_to_city">{{ form.fields.to_city.label }}</label>#}
|
||||
{# <input type="text" name="to_city"{% if form.fields.to_city.required %} required{% endif %} id="id_to_city">#}
|
||||
{# </div>#}
|
||||
{# <div>#}
|
||||
{# <label for="id_from_city">{{ form.fields.from_city.label }}</label>#}
|
||||
{# <input type="text" name="from_city"{% if form.fields.from_city.required %} required{% endif %} id="id_from_city">#}
|
||||
{# </div>#}
|
||||
{# <div>#}
|
||||
{# <label for="id_to_city">{{ form.fields.to_city.label }}</label>#}
|
||||
{# <input type="text" name="to_city"{% if form.fields.to_city.required %} required{% endif %} id="id_to_city">#}
|
||||
{# </div>#}
|
||||
<div class="from_to_place">
|
||||
<div>
|
||||
<label for="id_from_place">{{ form.fields.from_place.label }}</label>
|
||||
@@ -155,29 +202,40 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
|
||||
<div>
|
||||
<label for="id_cargo_type">{{ form.fields.cargo_type.label }}</label>
|
||||
</div>
|
||||
{#<div>#}
|
||||
{# <select#}
|
||||
{# multiple#}
|
||||
{# size="5"#}
|
||||
{# name="cargo_type"#}
|
||||
{# id="id_cargo_type"#}
|
||||
{# {% if form.fields.cargo_type.required %} required{% endif %}>#}
|
||||
{# {% for item in form.fields.cargo_type.choices %}#}
|
||||
{# <option#}
|
||||
{# value="{{ item.0 }}"{% if form.fields.cargo_type == item.0 %}#}
|
||||
{# selected="selected"{% endif %}>{{ item.1 }}#}
|
||||
{# </option>#}
|
||||
{# {% endfor %}#}
|
||||
{##}
|
||||
{# </select>#}
|
||||
{#<div>#}
|
||||
{# <select#}
|
||||
{# multiple#}
|
||||
{# size="5"#}
|
||||
{# name="cargo_type"#}
|
||||
{# id="id_cargo_type"#}
|
||||
{# {% if form.fields.cargo_type.required %} required{% endif %}>#}
|
||||
{# {% for item in form.fields.cargo_type.choices %}#}
|
||||
{# <option#}
|
||||
{# value="{{ item.0 }}"{% if form.fields.cargo_type == item.0 %}#}
|
||||
{# selected="selected"{% endif %}>{{ item.1 }}#}
|
||||
{# </option>#}
|
||||
{# {% endfor %}#}
|
||||
{##}
|
||||
{# </select>#}
|
||||
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
|
||||
<div>
|
||||
{% for item in form.fields.cargo_type.choices %}
|
||||
<input
|
||||
type="checkbox"
|
||||
name="cargo_type"
|
||||
id="id_cargo_type"
|
||||
{% if form.fields.cargo_type.required %} required{% endif %}
|
||||
value="{{ item.0 }}"
|
||||
{% if form.fields.cargo_type == item.0 %}
|
||||
{% endif %}/>{{ item.1 }}
|
||||
{% endfor %}
|
||||
<div class="checkbox_cargo_type">
|
||||
{% for item in form.fields.cargo_type.choices %}
|
||||
<input
|
||||
@@ -190,16 +248,16 @@
|
||||
{% endif %}/>{{ item.1 }}
|
||||
{% endfor %}
|
||||
|
||||
{# <lable for="">#}
|
||||
{##}
|
||||
{# </lable>#}
|
||||
{# <lable for="">#}
|
||||
{##}
|
||||
{# </lable>#}
|
||||
{% if form.errors and form.errors.cargo_type %}
|
||||
<span>{{ form.errors.cargo_type }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
|
||||
<div class="range-slider">
|
||||
<label for="id_weight">{{ form.fields.weight.label }}</label>
|
||||
@@ -208,7 +266,7 @@
|
||||
id="id_weight"
|
||||
{% if form.fields.weight.required %} required{% endif %}
|
||||
name="weight"
|
||||
{# value=""#}
|
||||
{# value=""#}
|
||||
{% if form.cleaned_data.weight %}value="{{ form.cleaned_data.weight}}"{% endif %}
|
||||
/>
|
||||
{% if form.errors and form.errors.weight %}
|
||||
@@ -216,9 +274,9 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
|
||||
<div class="phone">
|
||||
<div class="phone">
|
||||
<div>
|
||||
<label for="id_phone">{{ form.fields.phone.label }}</label>
|
||||
<input
|
||||
@@ -249,9 +307,9 @@
|
||||
<span>{{ form.errors.extra_phone }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
|
||||
<div>
|
||||
<label for="id_receive_msg_by_email">{{ form.fields.receive_msg_by_email.label }}</label>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
<option {% if form.cleaned_data.from_address_point_txt %}{% endif %} value="{{ id }}">
|
||||
{{ form.cleaned_data.from_address_point_txt }}
|
||||
</option>
|
||||
<option value=""></option>
|
||||
|
||||
Reference in New Issue
Block a user