title: form onclick create js var to use in jquery function for form name
body: <p>I have 4 forms on 1 page, one for each package. Can I use the form's onclick to establish a var and use it in the jquery function? The jquery function is included in a js file assigned to the the page. Just want to access the var in the jquery function for a specific form to be submitted.</p>
  
  <pre><code>    &lt;form action="javascript:" method="POST" id="buy-form_2" 
  onclick="javascript:$thisform='buy-form_2';" &gt;
  
      var thisformtext = "#"+$thisform;
  $(document).ready(function() 
  {
      $(thisformtext).submit(function(event)
      {
  </code></pre>
  
  <p>i may or may not be close but this one escapes me...</p>
  
  <p>Very curious</p>
  
  <p>Edit: ended up using:</p>
  
  <pre><code>$('form').submit(function(event){       
  
  window.buyform = '#'+"buy-form_"+$(this).attr('id').slice(-1);//alert(buyform); 
  
  .......
  
  }
  </code></pre>
  
  <p>I know window.var is overloaded but beats 4 X 12 jquery functions</p>
  
  <p>Thanks for the help! </p>
  
  <p>W</p>