title: loading ajax data in jquery ui modal (after submit)
body: <p>I would like to pass data from a input form to my codeigniter controller, then return a view via JSON that will then be opened in a jquery ui dialog modal...phew!</p>
  
  <p>It isn't working though.  On submit, it refreshes the page, and no alerts work either (if I put it at the beginning of the findcat() function).</p>
  
  <p>Here is my Javascript function: </p>
  
  <pre><code>function findcat(){
      var valinput = $('#category_form').val();
      $.ajax({
          type: "POST",
          async: true,
          url: 'http://rickymason.net/omnia/ajax/findcategory',
          dataType: 'json', 
          data: { valinput: valinput },
          success: function(content){
              $('#category_modal').html(content['content']);
              $('#category_modal').dialog({
                  autoOpen: false,
                  title: 'Hello',
                  modal: true,
                  height: 350,
                  resizable: false 
              });
          return false;
          }
      });  
  }
  </code></pre>
  
  <p>And my HTML:</p>
  
  <pre><code>&lt;div class="cus_input"&gt;
      &lt;form id="category_form" onsubmit="return findcat();"&gt;
          &lt;input type="text" id="category_input" name="category_input" placeholder=" Find Category"/&gt;
          &lt;input type="image" id="category_submit" src="&lt;?php echo base_url() ?&gt;img/board/icons/add.jpg" id="homeSubmit" value="X"/&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>my controller is just a mockup to try and send some sort of content back:</p>
  
  <pre><code>    public function findcategory()
      {
          $page['content'] = 'hello-testing';
          return json_encode($page);
      }
  </code></pre>