Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Ajax Form All Data Send

 $('#submit').on('click', function() {
             $.ajax({
                 url: "controller/php/add_project.php",
                 type: "POST",
                 data:  new FormData(document.getElementById("add_project_form")),
                 contentType: false,
                 processData:false,
                 cache: false,
                 success: function(dataResult){
                        console.log(dataResult);
                        var dataResult = JSON.parse(dataResult);
                        
                 },
                 error:function(dataResult){
                     console.log(dataResult);
                     alert('error / Add Project Again');
                 }
             });
         });
Comment

ajax call with form data

$.ajax({
    url: "jobs/php/job_single.php?type=500",
    type: "POST",
    data:  new FormData(document.getElementById("form")),
    contentType: false,
    processData:false,
    cache: false,
    success: function(dataResult){
      console.log(dataResult);
      if(dataResult == 999){
        alert("Incomplete Information Provided");
      }
      else{
        if(dataResult == 1){
        	alert("Job Application successful");
        	location.reload();
        }
        else if(dataResult == 0){
        	alert("Error applying for job, Please try again");
        }

      }
    }
}); 
Comment

ajax get form data

var form = // Select your form here;
var fmData = new FormData();
form.append('name',fmData);
$.ajax({
  url:'URL',
  type:'POST',
  data:fmData,
  success:function(){},
  error:(er){}
})
Comment

.ajax how to get data from form

$.ajax({
    ...
    data: $("#registerSubmit").serialize(),
    ...
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add up all the numbers in between 0 and that number 
Javascript :: number constructor js 
Javascript :: append row javascript 
Javascript :: xlsx to json javascript 
Javascript :: how to get class name in jquery 
Javascript :: get last two digits of year javascript 
Javascript :: index.js:3 Uncaught ReferenceError: $ is not defined at index.js:3 
Javascript :: Loop over all keys in the local storage 
Javascript :: check if input is valid js 
Javascript :: javascript if shorthand 
Javascript :: how to download express without view 
Javascript :: ajax syntax in javascript 
Javascript :: change color js 
Javascript :: javascript two character integer 
Javascript :: how to remove minutes with moment js 
Javascript :: found page without a React Component as default export in 
Javascript :: reverse words in a string javascript 
Javascript :: how to remove character from string in javascript 
Javascript :: javascript loop over the alphabet and return the vowels 
Javascript :: unity javascript 
Javascript :: express get query parameters 
Javascript :: how to make a translator in javascript 
Javascript :: javascript error logging 
Javascript :: js Float32Array to percentage 
Javascript :: JavaScript Use clearInterval() Method 
Javascript :: check many keys in objects 
Javascript :: jquery dropdown select 
Javascript :: clean url javascript 
Javascript :: Accessing $route.params in VueJS 
Javascript :: how to click on the datepicker date in jquery 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =