Reputation: 79
The plan is to clear input fields after part of form is sucessfuly posted using ajax. I cannot clear all form, rest of fields are required. This does not work:
$.ajax({
url : "http://mysite.lv/projects/addform",
type: "POST",
data : myArray,
success: function(){
document.getElementById("alias").clearForm();
Upvotes: 2
Views: 48
Reputation: 82241
You can simply set empty val using .val('')
for inputs in form. something like this:
$('#alias input[type=textbox]').val('');
Upvotes: 1