You're calling "require" and then attaching the event handlers:
So put those event handlers for username and submitImage INSIDE a jQuery on document load call, i.e.Code:require(["jquery", "utility"], function ($, MO) { $("#username").on("focus", function () { $("#username").parent().removeClass("error"); }); // etc. });
That way it will run after the document has been loaded and the event handlers will attach correctly.Code:require(["jquery", "utility"], function ($, MO) { $(function() { // <--- new bit $("#username").on("focus", function () { $("#username").parent().removeClass("error"); }); // etc. }); // <--- end of new bit });




Reply With Quote
