Jquery How to send HTTP request after form control ?

Jquery How to send HTTP request after form control ?

Hello

How to send a HTTP request with Ajax after checking if the inputs ".name_column" and ".taille" are not empty.
Both inputs are create dinamycally with the append function.
Than you in adavance.

Joce.
  1. $(".btn_validate").click(function () {
  2. //alert('btn_validate');
  3. //---------------------------
  4. //FORM CONTROL
  5. //---------------------------
  6. $('.name_column').each(function(){
  7. $(this).change(function(){
  8. $(this).css({"border" : "", "background-color" : ""});
  9. });
  10. if( !$(this).val() ){
  11. $(this).css({"border" : "1px solid red", "background-color" : "#FFEEF0"});
  12. $( "#alertBox" ).fadeIn(500).delay(1200).fadeOut(500).html("<p style='display:inline-block; width:20%; height:100px; line-height:100px; vertical-align:middle;'><span style='font-size:3em;' class='heydings_controls'>G</span></p><p style='display:inline-block; width:70%; height:25px; line-height:25px; vertical-align:middle; text-align:left;'> Veuillez saisir le nom.</p>");
  13. $("html, body").animate({ scrollTop: 0 }, "slow");
  14. return false;
  15. }
  16. });

  17. $('.taille').each(function(){
  18. $(this).change(function(){
  19. $(this).css({"border" : "", "background-color" : ""});
  20. });
  21. if( !$(this).val() ){
  22. $(this).css({"border" : "1px solid red", "background-color" : "#FFEEF0"});
  23. $( "#alertBox" ).fadeIn(500).delay(1200).fadeOut(500).html("<p style='display:inline-block; width:20%; height:100px; line-height:100px; vertical-align:middle;'><span style='font-size:3em;' class='heydings_controls'>G</span></p><p style='display:inline-block; width:70%; height:25px; line-height:25px; vertical-align:middle; text-align:left;'> Veuillez saisir la taille.</p>");
  24. $("html, body").animate({ scrollTop: 0 }, "slow");
  25. return false;
  26. }
  27. });



  28. //---------------------------
  29. //SERVER CONNEXION
  30. //---------------------------
  31. var formData = $( "#mySQL_table" ).serialize();
  32. alert(formData);
  33. $.ajax({
  34. type: "POST",
  35. url: "process.php",
  36. data: formData,
  37. dataType: "html",
  38. success: function(data){
  39. //$('#mySQL_table')[0].reset();
  40. //alert(data);
  41. $( "#showFormProcess" ).html(data);
  42. }
  43. });
  44.    
  45. });