0.0.105
This commit is contained in:
@@ -480,6 +480,14 @@ body.n_scroll{
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.container_content_form_feedback.hide{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.place_f_after_send.hide{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.container_input{
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
@@ -495,10 +503,12 @@ body.n_scroll{
|
||||
outline: none;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 20px;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
.input_form_feedback.error{
|
||||
border-bottom: 1px solid #FF3F20;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
.input_form_feedback::placeholder{
|
||||
@@ -512,6 +522,7 @@ body.n_scroll{
|
||||
display: block;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
.textarea_form_feedback{
|
||||
@@ -524,10 +535,12 @@ body.n_scroll{
|
||||
padding: 20px 0 20px 20px;
|
||||
font-size: 16px;
|
||||
font-family: -apple-system, 'Roboto', sans-serif;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
.textarea_form_feedback.error{
|
||||
border: 1px solid #FF3F20;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
.description_form_feedback_txt{
|
||||
@@ -559,6 +572,9 @@ body.n_scroll{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
.button_form_feedback.hide{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.button_form_feedback:hover{
|
||||
color: #ffffff;
|
||||
@@ -581,9 +597,11 @@ body.n_scroll{
|
||||
height: 15px;
|
||||
outline: none;
|
||||
margin: 6px 0;
|
||||
transition: 500ms;
|
||||
}
|
||||
.check_box_form_feedback.error{
|
||||
border: 1px solid #FF3F20;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
.label_feedback_form_checkbox{
|
||||
@@ -592,9 +610,11 @@ body.n_scroll{
|
||||
font-weight: 400;
|
||||
width: 90%;
|
||||
float: right;
|
||||
transition: 500ms;
|
||||
}
|
||||
.label_feedback_form_checkbox.error{
|
||||
color: #FF3F20;
|
||||
transition: 500ms;
|
||||
}
|
||||
|
||||
/* block plugin*/
|
||||
@@ -1243,3 +1263,13 @@ body.n_scroll{
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
/* form feedback after send*/
|
||||
|
||||
.w_after_send{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
font-size: 36px;
|
||||
margin: 26px 0;
|
||||
}
|
||||
@@ -235,28 +235,37 @@ function autoPlaySlider () {
|
||||
|
||||
// form feedback
|
||||
function sendFormfeedback (el){
|
||||
event.preventDefault()
|
||||
let form = el.form
|
||||
let formData = new FormData(form)
|
||||
$.ajax({
|
||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
url: '/send_feedback_form/',
|
||||
type: "POST",
|
||||
// async: true,
|
||||
cache: false,
|
||||
processData: false,
|
||||
enctype: 'multipart/form-data',
|
||||
contentType: false,
|
||||
// contentType: "application/json; charset=utf-8",
|
||||
data: formData,
|
||||
success: function(data){
|
||||
document.querySelector(".container_content_form_feedback").innerHTML = data.html
|
||||
},
|
||||
error: function (data){
|
||||
document.querySelector(".form_feedback_content").innerHTML = data.responseJSON.left_form_html
|
||||
document.querySelector(".checkbox_container").innerHTML = data.responseJSON.right_form_html
|
||||
if (!document.querySelector(".container_content_form_feedback").classList.contains('hide')){
|
||||
event.preventDefault()
|
||||
let form = el.form
|
||||
let formData = new FormData(form)
|
||||
let btn_form = document.querySelector(".button_form_feedback")
|
||||
if (!btn_form.classList.contains("hide")){
|
||||
btn_form.classList.add('hide')
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
url: '/send_feedback_form/',
|
||||
type: "POST",
|
||||
// async: true,
|
||||
cache: false,
|
||||
processData: false,
|
||||
enctype: 'multipart/form-data',
|
||||
contentType: false,
|
||||
// contentType: "application/json; charset=utf-8",
|
||||
data: formData,
|
||||
success: function(data){
|
||||
document.querySelector(".place_f_after_send").innerHTML = data.html
|
||||
document.querySelector(".place_f_after_send").classList.remove("hide")
|
||||
document.querySelector(".container_content_form_feedback").classList.add('hide')
|
||||
},
|
||||
error: function (data){
|
||||
document.querySelector(".form_feedback_content").innerHTML = data.responseJSON.left_form_html
|
||||
document.querySelector(".checkbox_container").innerHTML = data.responseJSON.right_form_html
|
||||
btn_form.classList.remove('hide')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteErrorsInput (el) {
|
||||
@@ -278,4 +287,28 @@ function deleteErrorsInput (el) {
|
||||
str = str.replace(str,'')
|
||||
errors_container.outerHTML = str
|
||||
}
|
||||
}
|
||||
|
||||
function resetForm () {
|
||||
let form = document.querySelector(".container_content_form_feedback")
|
||||
form.classList.remove("hide")
|
||||
let elements_form = document.querySelectorAll('.el_form_feedback')
|
||||
for (let i = 0;i < elements_form.length;i++){
|
||||
let cur_el = elements_form[i]
|
||||
if (cur_el.value) {
|
||||
cur_el.value = ''
|
||||
}
|
||||
if (cur_el.checked){
|
||||
cur_el.checked = false
|
||||
}
|
||||
let label_w_error = cur_el.parentNode.querySelector(".label_feedback_form_checkbox.error")
|
||||
if (label_w_error){
|
||||
label_w_error.classList.remove("error")
|
||||
}
|
||||
}
|
||||
document.querySelector(".place_f_after_send").classList.add('hide')
|
||||
let btn_form = document.querySelector(".button_form_feedback")
|
||||
if (btn_form.classList.contains("hide")){
|
||||
btn_form.classList.remove('hide')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user