I have a form loaded from AJAX. On this form there is a input type button which i would like to manage like it
$("#button_id").on("click",function(){..});
but it's does not work...
My question is how to do this work?
Javascript/Jquery load form code
function openForm('commandForm')
{
$.ajax({
type: "POST",
url: "./forms/commandForm.php",
data: $('#'+frm).
dataType: "html",
beforeSend: function(msg){
$('#ResponseDiv').html('Loding....');
},
success: function(back_data){
$('#ResponseDiv').html(back_data);
}
});
}
commandForm.php
<form id="commandForm" action="postCommand.php" method="post" >
.....
....
<button type="Button" id="postButton" />
</form>
Jquery on postButton onclick
$(document).ready(function () {
$('#postButton').on("click", function (e) {
/*....*/
}); //This don't work
}
PS: I don't want submit the form directly! Just make my own checkform running in my javascript function...out of here. So i want only that the button react on the Onclick ...so to do an alert for example or any javacript function else