title: asp.net: run javascript on click?
body: <p>i have a form and a button a form:</p>
  
  <pre><code>&lt;asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData"  /&gt;
  </code></pre>
  
  <p>i have a method in my c# program. the method is called <code>SubmitData</code></p>
  
  <p>however i would also like to run a javascript function on this button click as well. how do i do this?</p>
  
  <p>here is my javascript function:</p>
  
  <pre><code>var selectedLanguages = new Array();
  jQuery('#lstProblems option:selected').each(function() {
      selectedLanguages.push(jQuery(this).val());
  });
  </code></pre>
  
  <p>i got it from here: <a href="https://stackoverflow.com/questions/7409199/jquery-listbox-return-what-user-selected">jquery listbox return what user selected</a>    </p>
  
  <p>how do i run it ? do i have to put it in <code>&lt;script&gt;&lt;/script&gt;</code> and do some_Function(etc...) ?</p>