0.0.283 add success_msg for forms, clear forms
This commit is contained in:
@@ -1888,11 +1888,26 @@ button#edit_route {
|
||||
font-weight: 700;
|
||||
background: #FFFFFF;
|
||||
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 101%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.msg_text {
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
|
||||
.msg_send.hide{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form_wrapper{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
button.confirm_remove{
|
||||
width: 48.5%;
|
||||
|
||||
@@ -202,6 +202,8 @@ function cancelRemove(route_id) {
|
||||
function hideBlock(el) {
|
||||
|
||||
el.classList.add('hide')
|
||||
let clear_form = document.getElementsByClassName('clear_form');
|
||||
clear_form[0].reset();
|
||||
|
||||
}
|
||||
|
||||
@@ -800,6 +802,9 @@ function RequestCommercialOffer (el){
|
||||
|
||||
event.preventDefault()
|
||||
|
||||
let disable_btn = document.getElementById('send_feedback_form');
|
||||
disable_btn.setAttribute('disabled', true);
|
||||
|
||||
let form = el.form;
|
||||
let formData = new FormData(form);
|
||||
let form_name = form.dataset['name']
|
||||
@@ -819,6 +824,8 @@ function RequestCommercialOffer (el){
|
||||
success: function(data){
|
||||
|
||||
$(data.html).insertBefore(document.querySelector(".feedback_form"))
|
||||
let disable_btn = document.getElementById('send_feedback_form');
|
||||
disable_btn.removeAttribute('disabled');
|
||||
|
||||
|
||||
},
|
||||
@@ -828,38 +835,38 @@ function RequestCommercialOffer (el){
|
||||
});
|
||||
}
|
||||
|
||||
function SendFeedbackForm (el){
|
||||
|
||||
event.preventDefault()
|
||||
let form = el.form;
|
||||
let formData = new FormData(form);
|
||||
let form_name = form.dataset['name']
|
||||
formData.set('form_name',form_name)
|
||||
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
// url: '/user_account/request_offer/',
|
||||
type: "POST",
|
||||
// async: true,
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
// enctype: 'json',
|
||||
data: formData,
|
||||
success: function(data){
|
||||
|
||||
// location.href = '/profile'
|
||||
|
||||
|
||||
},
|
||||
error: function (data, exception){
|
||||
// document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||
}
|
||||
});
|
||||
}
|
||||
// function SendFeedbackForm (el){
|
||||
//
|
||||
// event.preventDefault()
|
||||
// let form = el.form;
|
||||
// let formData = new FormData(form);
|
||||
// let form_name = form.dataset['name']
|
||||
// formData.set('form_name',form_name)
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// $.ajax({
|
||||
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
// // url: '/user_account/request_offer/',
|
||||
// type: "POST",
|
||||
// // async: true,
|
||||
// cache: false,
|
||||
// processData: false,
|
||||
// contentType: false,
|
||||
// // enctype: 'json',
|
||||
// data: formData,
|
||||
// success: function(data){
|
||||
//
|
||||
// // location.href = '/profile'
|
||||
//
|
||||
//
|
||||
// },
|
||||
// error: function (data, exception){
|
||||
// // document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user