title: passing parameter from velocity to javascript
body: <p>I have added onfocus and onclick to select and written java script function as shown below. using velocity i.e., <code>.vm</code> files to invoke javascript function.</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
                  function fixA(val){
                      alert(val);                              
                     // document.getElementById(val).style.zIndex="100";
                     val.style.zIndex=300;
                  }
                  function fixB(val){
                      alert(val);                               
                     // document.getElementById(val).style.zIndex="300";
                        val.style.zIndex=300;
                  }
  
              &lt;/script&gt;
  
  
  #elseif ( $el.type.code == "listbox" )
  #if( $errorFields.contains($name) )
      &lt;div class="label selectbox big error"&gt; 
  #else
      &lt;div class="label selectbox big" &gt;
  #end
      #if ($el.label)
          #if ($el.mandatory)
              &lt;label class="label_content" for="$name"&gt;$el.label *&lt;/label&gt;
          #else
              &lt;label class="label_content" for="$name"&gt;$el.label&lt;/label&gt;
          #end
      #end
      &lt;select class="select_styled" id="$name" name="$name" onfocus="fixA($name)" onclick="fixB($name)" &gt;
          #foreach($val in $el.values)
              #set ($sel = "")
              #if ($allInputFields.get($name) == $val)
                  #set ($sel = ' selected="selected"')
              #end
              &lt;option$sel onclick="resetIndex()"&gt;$val&lt;/option&gt;
          #end
      &lt;/select&gt;
      &lt;div class="clr"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>1)I am using IE7 and it is not working, it is working fine in FF.</p>
  
  <p>2) <code>alert(val)</code> gives value of <code>[object HTMLSelectElement]</code>, but <code>alert( document.getElementById(val));</code> gives null. how can i solve it?</p>