title: onclick call to function from submit input not working
body: <p>Here is my submit button written dynamically through AJAX:</p>
  
  <pre><code>var htmlpage = "&lt;div class='pages'&gt;"
                  for (i=1 ; i &lt; pages+1 ; i++)
                      {
                          htmlpage += "&lt;li&gt;&lt;input type='submit' value='"+i+"' onclick='updatefilters;' /&gt;&lt;/li"
                      }
                  htmlpage += "&lt;div&gt;"    
                  htmlpage += "&lt;/ul&gt;";
  </code></pre>
  
  <p>I am trying to rerun the updatefilters() function to change the items that are displayed.  I imagine its a bit tough to conceptualize without seeing all the code...but essentially, all I need to do is run the function again on each click of the submit button...right now, its giving me a <code>updatefilters is undefined</code> error in firebug.</p>
  
  <p>Heres my whole JS for reference</p>
  
  <pre><code>$(function() {
      $( "#selectable" ).selectable({
          selected: updatefilters  
      });
      getactivesession();
      function getactivesession(ev, ui){
          var i = 0;
          var actfilter, strfilter;
          var strfilterarray = new Array();
          $.ajaxSetup({cache: false})
          $.ajax({
          type: "POST",  
          async: false,
          url: 'welcome/getactivesession', 
          dataType: 'json',
          success: function (data){
              strfilter = JSON.stringify(data)
              strfilterarray = strfilter.split(',')
              for (i=0 ; i &lt; strfilterarray.length ; i++) {
                  strfilter = strfilterarray[i]
                  strfilter = strfilter.replace(/[\[\]'"]+/g,'');
                  var strfilterdash = strfilter.replace(/\s+/g, '-')
                  actfilter = '#'+ strfilterdash
                  $(actfilter).addClass('ui-selected')
              }
              updatefilters();
          }
          });
      }
  
      function updatefilters(ev, ui){
          // get the selected filters
          var template, html;
          var i = 0;
          var page;
          if(! page){
              page = 0; 
          }
  
          var $selected = $('#selectable').children('.ui-selected');
          // create a string that has each filter separated by a pipe ("|")
          var filters = $selected.map(function(){return this.id;}).get().join("\|");
          $.ajax({
              type: "POST",
              async: false,
              url: 'welcome/updatefilters',
              dataType: 'json', 
              data: { filters: filters, page: page },
              success: function(data){
                  var html = "";
                  html += "&lt;div id=board&gt;"
                  html += "&lt;div class='board' id='table'&gt;"
                  html += "&lt;div id='row'&gt;header here&lt;/div&gt;"
                  var pages = Math.ceil(data['num_threads']/10);
                  var htmlpage = "&lt;div class='pages'&gt;"
                  for (i=1 ; i &lt; pages+1 ; i++)
                      {
                          htmlpage += "&lt;li&gt;&lt;input type='submit' value='"+i+"' onclick='updatefilters;' /&gt;&lt;/li"
                      }
                  htmlpage += "&lt;div&gt;"    
                  htmlpage += "&lt;/ul&gt;";
                  htmlpage += "&lt;/br&gt;";
                  html += htmlpage;
                  for (i=0 ; i &lt; data['threads'].length ; i++)
                  {
                      html += "&lt;div id=row&gt;";
                      html += "   &lt;div id='author' style='background: url("+data['threads'][i].location + ") no-repeat; background-position: center;'&gt;&lt;p&gt;"+data['threads'][i].username + "&lt;/p&gt;&lt;/div&gt;";
                      html += "   &lt;div id='arrow'&gt;&lt;/div&gt;";
                      html += "   &lt;div id='subject' title='"+ data['threads'][i].body +"'&gt;";
                      html += "       &lt;a href=thread/" + data['threads'][i].slug + "&gt;"+ data['threads'][i].subject +"&lt;/a&gt;&lt;p&gt;Created: "+data['threads'][i].posttime+"&lt;/p&gt;&lt;/div&gt;";                    
                      html += "   &lt;div id='info'&gt;";
                      html += "       &lt;div id='replies'&gt;" + data['threads'][i].replies_num + "&lt;/div&gt;";
                      html += "       &lt;div id='lastpost'&gt;"+ data['threads'][i].lastreply+"&lt;/div&gt;";
                      html += "   &lt;/div&gt;";
                      html += "&lt;/div&gt;";
                  }
                  html += "&lt;/div&gt;&lt;/div&gt;";
                  $('#board').html(html);
              }
          });
      } 
  });
  </code></pre>