Code: Select all
/**
* Called when all validations are completed
*/
_submit: function() {
var isValid = this.isValid(),
eventType = isValid ? this.options.events.formSuccess : this.options.events.formError,
e = $.Event(eventType);
this.$form.trigger(e);
// Call default handler
// Check if whether the submit button is clicked
if (this.$submitButton) {
isValid ? this._onSuccess(e) : this._onError(e) ;
}
},
What I want is if it's success (this._onSuccess(e)) to submit the form with the following code json:
Code: Select all
$("document").ready(function(){
$(".js-ajax-php-json").submit(function(){
var data = {
"action": "test"
};
data = $(this).serialize() + "&" + $.param(data);
$.ajax({
type: "POST",
dataType: "json",
url: "https://www.telekom.ro/delivery/formAction/fix-mobil/response.php", //Relative or absolute path to response.php file
data: data,
success: function(data) {
$(".the-return").html(
//"Favorite beverage: " + data["favorite_beverage"] + "<br />Favorite restaurant: " + data["favorite_restaurant"] + "<br />Gender: " + data["gender"] + "<br />JSON: " + data["json"]
data["ok"]
);
$(".error").html(
data["error"]
);
Practicaly I need to submit the form, then all the fields are validated, with that json code.
Can anyone help me please?