0

I want to get form fields but in the meantime I want to change some field's data before sending the request to the server and other fields should not be changed.

I have this jQuery code:

$.ajax({
  type: 'Post',
  url: '/Employee/EducationCreate',
  data: $("#form").serialize(),
  success: function () {
    var url = '/Employee/Education?EmployeeId=' + $("#employeeId").val();                          
  },
  error: function (xhr) {
    errorHandler(xhr);
  }
});

if I use:

var forms = $("#form").serialize(); 
                forms += "&StartDate=" + encodeURIComponent(georgianStartDate);

Then I will have an array of StartDate in output, but all I want is modify $("#form").serialize() not appending or adding an extra parameter.

Payam Khaninejad
  • 7,692
  • 6
  • 45
  • 55

0 Answers0