Plugin with database search in ajax

Hi all, 

I'm new on elg and I'm teaching to develope a plugin now, with help of the book "Elgg 1.8 socal networking" (http://www.amazon.it/dp/1849511306/ref=asc_df_184951130628143236/?tag=googshopit-21&creative=23390&creativeASIN=1849511306&linkCode=df0)

I have basically rewritten the first example of the plugin libo that obviously works. Then I changed the page displayed by the plugin by entering an input form with fields of research as below:

$body = elgg_view_layout('one_sidebar', $vars);

$body = "<body> 

<script type=\"text/javascript\" src=\"jquery-2.1.4.min.js\"></script>

<script type=\"text/javascript\">
    $(document).ready(function() 
    {
        $(\"#input_form\").submit(function(){
    var codAic = $(\"#CodiceAic\").attr('value');
        var principioAttivo = $(\"#PrincipioAttivo\").attr('value');
    $.post(\"result.php\", {codAic:codAic, principioAttivo:principioAttivo }, function(data){
    $(\"div#result\").html(data);
    });
    return false;
    
    });
</script>


<br>
<form id=\"formMedicine\" name=\"Medicine\" method=\"post\" action=\"?\">
  <p>
    Codice Aic: <input name=\"CodiceAic\" type=\"text\" id=\"CodiceAic\" />
    Principio Attivo: <input type=\"text\" name=\"PrincipioAttivo\" id=\"PrincipioAttivo\" />
  </p>
  <p>
    Denominazione: <input type=\"text\" name=\"Denminazione\" id=\"Denminazione\" />
    Ditta: <input type=\"text\" name=\"Ditta\" id=\"Ditta\" />
  </p>
  <p>
   <input type=\"submit\" value=\"cerca\">
  </p>
  </form>
  <p>&nbsp;</p>
  
  <div id=\"result\"> </div>";

 
echo elgg_view_page($title, $body);

in the file result.php there is only this:

<?php

echo "Hai inserito i seguenti dati: Codice Aic‐><strong>$_POST[codAic]</strong> e Principio Attivo‐><strong>$_POST[principioAttivo]</strong>. Hai eseguito una chiamata ascinrona!";

?>

I also tried this way:
 

<?php

echo " $body .= \"Hai inserito i seguenti dati: Codice Aic‐><strong>$_POST[codAic]</strong> e Principio Attivo‐><strong>$_POST[principioAttivo]</strong>. Hai eseguito una chiamata ascinrona!\";" ;

?>

The result is evere a refresh of the div but I see nothing.

Can anyone help me?