Hotfix: ShortenLink & feedbackForm JS

This commit is contained in:
Divlo 2020-01-20 22:01:48 +01:00
parent 06d0d9c136
commit b93971f90f
2 changed files with 22 additions and 22 deletions

View File

@ -1,16 +1,16 @@
$(function () {
$('#formLinkShortener').submit((event) => {
event.preventDefault();
const postdata = $('#formLinkShortener').serialize();
$('#feedbackForm').submit((e) => {
e.preventDefault();
const postdata = $('#feedbackForm').serialize();
$.ajax({
type: 'POST',
url: '../../php/shortenLink.php',
url: '../../php/feedbackForm.php',
data: postdata,
success: (text) => {
try {
$(".results").html(JSON.parse(text).message);
} catch (error) {
$(".results").html("URL invalide.");
success: (response) => {
const result = JSON.parse(response);
$(".results").html(result.message);
if(result.isSuccess) {
$("#feedbackForm")[0].reset();
}
}
});

View File

@ -14,6 +14,7 @@ $(function () {
}
}
});
});
// Affiche l'input selon le choix de l'utilisateur sur la page linkShortener
$('.hideUserShortcut').hide();
@ -24,5 +25,4 @@ $(function () {
$('.hideUserShortcut').hide();
}
});
});
});