Hotfix: ShortenLink & feedbackForm JS
This commit is contained in:
		| @@ -1,18 +1,18 @@ | ||||
| $(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(); | ||||
|                 } | ||||
| 			} | ||||
| 		}); | ||||
|     }); | ||||
| 	}); | ||||
| }); | ||||
| @@ -14,15 +14,15 @@ $(function () { | ||||
| 				} | ||||
| 			} | ||||
| 		}); | ||||
|  | ||||
| 		// Affiche l'input selon le choix de l'utilisateur sur la page linkShortener | ||||
| 		$('.hideUserShortcut').hide(); | ||||
| 		$("#option").bind("keyup change", () => { | ||||
| 			if ($("#option").val() == "userShortcut") { | ||||
| 				$('.hideUserShortcut').show(); | ||||
| 			} else { | ||||
| 				$('.hideUserShortcut').hide(); | ||||
| 			} | ||||
| 		}); | ||||
|     }); | ||||
| 	}); | ||||
| 	 | ||||
| 	// Affiche l'input selon le choix de l'utilisateur sur la page linkShortener | ||||
| 	$('.hideUserShortcut').hide(); | ||||
| 	$("#option").bind("keyup change", () => { | ||||
| 		if ($("#option").val() == "userShortcut") { | ||||
| 			$('.hideUserShortcut').show(); | ||||
| 		} else { | ||||
| 			$('.hideUserShortcut').hide(); | ||||
| 		} | ||||
| 	}); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user