_cleanFormFields
is a property of some object, right? So you can't call it directly, you need to reference it via your object:
yourObject._cleanFormFields();
Or, depending on how _addFormListener()
is invoked you might be able to use this
. But you'd need to keep a reference of the this
from _addFormListener()
because within the .submit()
callback this
will be the form element in question:
_addFormListener: function(map, marker) {
var form = $(".add-form").clone().show(),
self = this;
form.submit(function (event){
event.preventDefault();
self._cleanFormFields();
}
}