Could anyone give me a clue as to why this would not work.
I have a form:
<form id="add">
.
.
.
<button id="button1" type="submit">Submit</button>
</form>
And want to make inputs within the form readonly on submit (I know there is better ways to accomplish this but I am looking at this specific situation).
Why would this jquery not work:
$(document).ready(function(){
$("#add").on("submit", "input", function(event) {
console.log("hello");
event.preventDefault();
$(this).prop("readonly", true);
});
});
Thanks!