[Fixed]-How add name input submit() jQuery

1👍

One way you can do this is by creating a hidden input on your form, with a name of its own. Something like below.

<input type="hidden" name="buttonName" id="buttonName" />

Then, in your disableSubmit function, make it set the value of that input before submitting.

$(submitForm)
	.find("input[name=buttonName]")
	.attr("value",
		$(btn).attr("name")
	);

From there, you can just retrieve the “buttonName” value in your View.py.

0👍

you can use preventdefault or return false

$("#send-order").click(function (event) {
  event.preventDefault();
    return disableSubmit(this, "#order");
});

Or

<input id="send-order" value="Send" type="submit" onclick="disableSubmit(this, '#order');return false" />

Leave a comment