This is a strange one..
Essentially I have a three stage form which automatically saves it status.
When you click the first submit button it loads the second stage through ajax.
If you refresh the page it reloads the second stage (but NOT through ajax) using session data.
On the second stage of the form is a button.. when the user clicks it I want to call some jquery and make an alert.
My code is as follows:
$(document).on("click","#submity",function(event){
event.preventDefault();
alert('lol');
});
This is included between a document ready statement in an external js file loaded on the initial page load. It is loaded after the jQuery library, and that is being imported correctly.
When the second page is loaded by ajax, clicking the button does absolutely nothing. When loaded directly it alerts as expected. I cannot for the life of me work out why?
Other questions on SO seem to pertain to delegating with on() but as far as I am aware I have done it correctly, and similar setups work elsewhere on the site..
Any ideas?
Thanks