I'm wondering if echo'ing the jQuery script inside my PHP code will
work. If I do:

if($_POST['search_button']){
   echo "
          <script type='text/javascript'>
          alert('inside post branch');
          </script>
   ";
}

That works fine, but if I copy/paste in my jQuery code I want
executed:

if($_POST['search_button']){
   echo "
          <script type='text/javascript'>
          jQuery(function(){
              $('#form_search').bind('submit', function() {
                 //code here
             });
          });
          </script>
         ";
}

I think the error was jQuery is not defined.  It's just a copy/paste
of existing jQuery code that works fine elsewhere on the page.

Reply via email to