NebuJohn Posted January 9, 2015 Share Posted January 9, 2015 Somebody please help me. The below given code is not working. $(document).on('keyup', ".add_commi", function() { typingTimer = setTimeout(doneTyping, doneTypingInterval); var pro = $(this).attr('id'); var selectvalue = $(this).html(); var id = pro.slice(-2); var amount = $('#amount'+id).html(); var rate = $('#v_rate'+id).html(); //alert('working'); var data = 'cur_amount='+cur_amount +'&cur_rate='+cur_rate+'&commision='+selectvalue; $.ajax({ type: "POST", dataType: "json", url: "http://localhost/agent/buy-currency-calculations/", data: data, success: function(output){ var cus_rate = output.cus_rate; var total = output.total; var tot_commision = output.commision; alert(cus_rate, total, tot_commision); $('#curr_rate'+id).html(cus_rate); $('#tot'+id).html(total); $('#tot_commi'+id).html(tot_commision); } }); return false; }); The problem is with Ajax calling. Can somebody give me a hint to rectify this. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/293770-dynamically-loaded-textbox-not-working-with-ajax/ Share on other sites More sharing options...
wezhind Posted January 9, 2015 Share Posted January 9, 2015 (edited) Could you clarify please. Please describe what is happening and what you expect to happen a bit more if you can. You say the problem is with AJAX calling. Is it returning the wrong info or no info etc Or do you mean it isn't even calling the other page? Are you getting an error like 'page not found'? Is it getting to the alert(). Can you give us a little bit more to go on. edit: just had a quick read through...can't spot anything obvious at error on first run through. Only thing I can think of and this may not make any difference at all (and correct me if you know better - js not my strength)is: have you tried using the filename in the filepath the ajax is loading rather than just using the path and assuming it will automatically use index.php? In the code above it looks like you haven't named the file it should be loading. LIke I say I don't know if this will make a difference. Let us know the result either way. More info would be great. Good luck. Edited January 9, 2015 by wezhind Quote Link to comment https://forums.phpfreaks.com/topic/293770-dynamically-loaded-textbox-not-working-with-ajax/#findComment-1502250 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.