I have a PHP function which returns an array :
function lire( $id) {
$ret = array() ;
$sSQL = \"SELECT * FROM produit WHERE prod_code
this is the response to the comment you added earlier. I couldnt format it in the comment. Sorry.
$(document).ready(function() {
$("#idofinput").blur(function(){
var value = $.ajax({
type: "POST",
url: "some.php",
data: "name="+$("#idofinput").val(),
async: false
}).responseText;
myval= parseInt(value);
if(myval>0)
{
//your code goes here
}
else
{
//your code goes here
}
});
});
You may attach the function with the input element on document load.
replace the idofinput with input element id