I'm trying to get the value of an input with ajax, but i only manage to get the full input, not its value.
Here is my code:
$("#formulaire1").submit(function(e){ // On sélectionne le formulaire par son identifiant
e.preventDefault(); // Le navigateur ne peut pas envoyer le formulaire
var donnees = $(this).serialize(); // On créer une variable content le formulaire sérialisé
$.ajax({
url : 'index.php',
type : 'POST',
data : donnees,
success : function(data, statut){
if (text1 !== '') { $("#resultat").text(text1[0]);}
I think I should use .val() but I can't make it work while putting this result in #resultat.
Could you please help me?
thanks you very much!