Reputation: 6136
I'm loading form into jquery-ui dialog using jquery.html() function and then Submitting doesn't work (alert doesnt show) - can someone tell me why?
here it is: http://jsfiddle.net/GMcev/11/
Upvotes: 0
Views: 178
Reputation: 19
i suggest to put onclick in submit button
<input type='submit' name='submit' class='button'
id='submit' value='Zapisz' onclick='dingDong()' />
Upvotes: 2
Reputation: 87073
You need delegate event. Because your button is added to DOM after page load ie. dynamically, so you need something like following:
$('body').on('click', '.button', function() {
alert('TEST!'); //it doesnt work
});
Upvotes: 2
Reputation: 7442
Call
$(".button").click(function() {
alert('aaa');
in open action of dialog
$("#dialog").dialog({
autoOpen: false,
title: "contact",
open: function() {
$(".button").click(function() {
alert('aaa');
});
}
});
Upvotes: 2