The below is the PHP code in which i need to get the value of input-text onblur.
echo $script = "<script>";
$q = "select * from sp_documentocompra_detalle where dcd_codigo
='<script>document.getElementById('busqueda_de_producto').value;</script>'";
$res = mysql_query($q);
$row = mysql_fetch_array($res);
echo $script .= $row."</script>";
The below is the HTML code that includes the input-text.
<input type='text' name='busqueda_de_producto' id='busqueda_de_producto' value='' onclick="text();"/>
You have your php script and in your view file you can use AJAX to pass value on click.
and for the text input are do something like