javascript - jQuery dynamic DOM elements are not posted in PHP -
i have button id btngo
wrapped in form id frmnewrequest
. when tried use
$('#frmnewrequest').on('click', '#btngo', (function(e){ //do }));
it not working when changed
$('#btngo').click(function(e){ //do });
it working. different between 2 ?
i have dom dynamically generated upon click of btngo
, when posted codeigniter's controller, newly dom elements not posted. what's problem ?
first snippet of code tries click on form. there not method click on form element. so, not work.
whereas second snippet clicking on button , button have property click so, work you.
Comments
Post a Comment