i want to automatic insert data in database when bar code scanner scan any bar code with ajax plz help me...........
Are you taking on jobs and just coming here and asking people to do it for you? Try Googling and finding out how to do it yourself instead of expecting other people to do your work for you, We don't mind helping people out but you just come here and start thread after thread, You don't even say thanks when people help you out, I think you're just taking the piss.
hello sir, It's not a entertainment site i am search on google and find some script and using this but it's not working. find the code on google : <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#theBarcode').keyup(function(e){ barcode = $(this); // if Enter key was pressed, send the barcode to backend if( (e.keyCode == 13) && (barcode.val().length > 10)){ sendBarcode(barcode.val()); // clear the input barcode.val(''); } }); }); function sendBarcode(b){ $.post("r.php",{ barcode: b }, function(data){ if(data.status=='success'){ $('#display').html(data.content); } else { $('#display').html(data.message); } }, "json"); } </script> other script $(document).ready(function(){ $("#bcode").focus();//prevents autocomplete in some browsers $("#bcode").attr('autocomplete','off').keyup(function(event){ var name = $("#bcode").val(); $("#status").empty();if(name.length >17)`// need to check all possible length values like this`{ selectAll(); $("#status").html('<img align="absmiddle" src="images/loading.gif" /> Checking availability...').show(); $.ajax({ type:"POST", url:"namecheck.php", data :"bcode="+ name, success:function(msg){ $("#status").html(msg).show();}}); }else{ $("#status").html('').addClass('err').show();}});}); and other two script find and also do RND but i'm not success. so i'm post this thread.........
I agree. This question is also very hard to answer, it's not clear how you are scanning the code and do you even understand what the code above says? Maybe you didn't load jQuery, that would be one reason why its not working.
Also - to get the barcode automatically posting, you'd need to have a check on an input or textarea to see if it's empty or not, and then post it automatically if it's not. However, and this is important, unless you're ABSOLUTELY SURE that there will never be, for instance, someone typing something in the box, it might end up with the wrong information in the database. Also, you should do a check or something for existing entries - or you'll get double listings if you accidentally scan the code multiple times - it happens, believe me.