Use jQuery .on for dynamic future event not working for me -
i have dynamic form every post reply. using $('.upload_reply').on('submit', function(e){
. par jquery documentation future event should use 1 below not work me:
$(document).on('submit', '.upload_repimg',function (e){ //also tried $("body").delegate('.upload_repimg', 'submit', function(){
if use these, page refreshed without submitting form.
and if use current way, reply work 1st reply. means in case of 2 or more reply @ time, reply submit 1st one, next try, page refresh.
where problem please.
my form
<form class="upload_reply" method="post" id="up_rep'.$sid.'" enctype="multipart/form-data"> <input type="file" name="file" class="repfile" id="'.$sid.'" value="" /> <input type="submit" class="upload_repimg" id="'.$sid.'" name="upload_btn" value="upload picture"/> </form>
.upload_reply
form submit, .upload_repimg
thing click. suggest former: $(document).on('submit', '.upload_reply',function (e){
Comments
Post a Comment