Hi jQuery Gurus, This is a very interesting question. I have a drop down box and a button on page1.php Clicking on that button adds whatever it is in the dropdown in the database. I am using the following jQuery on page1.php <script> $(document).ready(function(){ $("#add").click(function(){ $(".status").html("Adding. Please Wait...").show("slow"); $.get("page2.php",{txtDropDown:$("#txtDropDown").val(),action:'add'},function(data){$("#quote").html(data);$(".status").html("Added Successfully.").hide("slow");}) return false; });//Submit function });//Ready function </script> Code (markup): - The .status div will show the current status. Like data added, data deleted, data updated successfully messages - The #quote div will display the added items. - Page2.php is doing all the processing. Now I have managed to program page2.php that it will not add one data more then once, How do I now display a message in the .status div that the item is already added in the database and that u cannot add the same item again? Thanx
You can do the traditional $i++ method, and then seeing if $i is greater than 1 - to count how many times the AJAX has been sent.