Почему я сталкиваюсь с 409 ошибкой конфликта < /p>
Я работаю над формой карьеры для отправки данных веб -сайта в Gmail.
Все прекрасно сделаны. Я делаю свой код в прямом эфире в CPanel, он будет прекрасно работать на моем ПК, и когда я использую другое устройство для заполнения данных и отправки моего кода, в консоли показать мне ошибку конфликта 409. < /p>
< /code>
// toastr.options = {
// positionClass: 'toast-top-right',
// timeOut: 3000,
// };
$(document).ready(function () {
$('#form').on('submit', function (event) {
// Example JavaScript code to disable submit button
this.disabled = true;
event.preventDefault(); // Prevent default form submission
// Perform client-side validation
let isValid = true;
const name = $('#name').val().trim();
const email = $('#email').val().trim();
const phone = $('#phone').val().trim();
const experience = $('#experience').val();
const resume = $('#file').val();
// Clear previous toastr messages
toastr.clear();
if (document.getElementById("name").value == "") {
// result.innerHTML = "Please Enter Your Name...";
toastr.error("Please Enter Your Name...");
isValid = false;
} else if (document.getElementById("email").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Enter Your Email...");
isValid = false;
}
else if (!validateEmail(email)) {
toastr.error('Invalid Email Address.');
isValid = false;
}
else if (document.getElementById("phone").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Enter Your Phone Number...");
isValid = false;
} else if (!/^\d{10}$/.test(phone)) {
toastr.error('Phone Number must be 10 digits.');
isValid = false;
} else if (experience.value == "") {
toastr.error("Please Select Your Work Experience.");
isValid = false;
}
else if (document.getElementById("file").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Upload Your CV...");
isValid = false;
}
// If validation passes, proceed with AJAX submission
if (isValid) {
const formData = new FormData(this);
$.ajax({
url: 'mail.php', // The PHP script that processes the form
// url: 'https://formbold.com/s/3Kr4p',
type: 'POST',
data: formData,
processData: false, // Prevent jQuery from converting the data
contentType: false, // Prevent jQuery from overriding the content type
success: function (response) {
console.log(response, "done");
toastr.success('Form submitted successfully!');
$('#form')[0].reset(); // Reset the form
},
error: function () {
toastr.error('An error occurred while submitting the form.');
},
});
}
});
// Helper function to validate email format
function validateEmail(email) {
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return re.test(email);
}
});
< /code>
< /code>
It will work perfectly in my pc and when i use another device to fill the data and submit my code then , in console show me the 409 conflict error.
Подробнее здесь: https://stackoverflow.com/questions/794 ... lict-error
Почему это не работает для другого пользователя, как исправить ошибку конфликта 409 для другого пользователя, поэтому он ⇐ Html
Программисты Html
1739465486
Anonymous
Почему я сталкиваюсь с 409 ошибкой конфликта < /p>
Я работаю над формой карьеры для отправки данных веб -сайта в Gmail.
Все прекрасно сделаны. Я делаю свой код в прямом эфире в CPanel, он будет прекрасно работать на моем ПК, и когда я использую другое устройство для заполнения данных и отправки моего кода, в консоли показать мне ошибку конфликта 409. < /p>
< /code>
// toastr.options = {
// positionClass: 'toast-top-right',
// timeOut: 3000,
// };
$(document).ready(function () {
$('#form').on('submit', function (event) {
// Example JavaScript code to disable submit button
this.disabled = true;
event.preventDefault(); // Prevent default form submission
// Perform client-side validation
let isValid = true;
const name = $('#name').val().trim();
const email = $('#email').val().trim();
const phone = $('#phone').val().trim();
const experience = $('#experience').val();
const resume = $('#file').val();
// Clear previous toastr messages
toastr.clear();
if (document.getElementById("name").value == "") {
// result.innerHTML = "Please Enter Your Name...";
toastr.error("Please Enter Your Name...");
isValid = false;
} else if (document.getElementById("email").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Enter Your Email...");
isValid = false;
}
else if (!validateEmail(email)) {
toastr.error('Invalid Email Address.');
isValid = false;
}
else if (document.getElementById("phone").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Enter Your Phone Number...");
isValid = false;
} else if (!/^\d{10}$/.test(phone)) {
toastr.error('Phone Number must be 10 digits.');
isValid = false;
} else if (experience.value == "") {
toastr.error("Please Select Your Work Experience.");
isValid = false;
}
else if (document.getElementById("file").value == "") {
// result.innerHTML = "Please Enter Email...";
toastr.error("Please Upload Your CV...");
isValid = false;
}
// If validation passes, proceed with AJAX submission
if (isValid) {
const formData = new FormData(this);
$.ajax({
url: 'mail.php', // The PHP script that processes the form
// url: 'https://formbold.com/s/3Kr4p',
type: 'POST',
data: formData,
processData: false, // Prevent jQuery from converting the data
contentType: false, // Prevent jQuery from overriding the content type
success: function (response) {
console.log(response, "done");
toastr.success('Form submitted successfully!');
$('#form')[0].reset(); // Reset the form
},
error: function () {
toastr.error('An error occurred while submitting the form.');
},
});
}
});
// Helper function to validate email format
function validateEmail(email) {
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return re.test(email);
}
});
< /code>
< /code>
It will work perfectly in my pc and when i use another device to fill the data and submit my code then , in console show me the 409 conflict error.
Подробнее здесь: [url]https://stackoverflow.com/questions/79437131/why-does-this-not-work-code-for-another-user-how-to-fix-the-409-conflict-error[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия