neither .post() nor ajax() will work with this code

neither .post() nor ajax() will work with this code

If I use .click(function  .post will access the url. If I use .change(function  .post will not work.

ajax will not work in either case

I am baffled. Can someone explain please.


  1.           
    <div id="forms">

        <fieldset>
             <form name="myName" id="myName" >
                  <p>To Search for a Name: Type Partial Name Then Enter:  <br>
                     To Display all Names: Type All Then Enter:<br></p>
      
                    <p> <label for='partName'>Enter Name</label>
                   <input type="text" class='hov'  name='partName' id='partName'/> </p>
     
               </form>
       </fieldset>
     
       
    </div>
    </div>

    <div id="rbox" >


    </div>

    <!-- =============== scripts2 ================ -->

    <script type="text/javascript" >

    $('#partName').change(function() { 

    var name=$('#partName').val();   

    $.post("pollyQueries.php", {"choice":name}, showTable, "json");


    /*
    $.ajax({
        type:"POST",
        url:"pollyQueries.php",
        data:{"choice":name},
        done: showTable
    });     

    */
       
    function showTable(pData) {
        alert('back from pollyQueries ????');
    }   
       
         
    }); // partName