title: JBoss - Function called on onblur event not giving any results or alerts
body: <p>I have few text boxes in my JSP. My requirement (for one of the text boxes) is to check the length of data entered by user in it, if it is less than the Max Length, I need to Prefix that many Zeros and Make it of Max Length.</p>
  <p>I had some existing code with existing functionality.</p>
  <p>I have just added some part in <code>onblur</code> event. As can be seen in the code below, I have tried to set the value from <code>zrs</code> variable when <code>onblur</code> occurs.</p>
  <p>The <code>zrs</code> variable is in turn being set by calling a <code>zeros()</code> function.</p>
  <p>I have pasted the code below for <code>zeros()</code> function for the reference.</p>
  <p>It's worth noting that, when I am deploying my code on Weblogic server, it works fine. It even gives me correct results and also the alerts added as part of Zeros function.</p>
  <p>But when I am deploying the same on JBoss, it does not give any alerts as well.
  I am using Internet Explorer for both the applications, built on Web Logic and JBoss.</p>
  <p>Can someone please look into it and guide me?</p>
  <pre><code>&lt;c:choose&gt;
      &lt;c:when test=&quot;${dto.loadpage == true}&quot;&gt;
                                              &lt;input type=&quot;hidden&quot; name=&quot;tmpValue[&lt;c:out value=&quot;${indexDto}&quot;/&gt;]&quot;  value=&quot;&lt;c:out value=&quot;${dto.valeurSaisiForm}&quot;/&gt;&quot;/&gt;
                                              &lt;c:set var=&quot;prop&quot; value=&quot;calculer(this,${dto.valMaxChamp},'${nomDuChamp}',${indexDto});&quot;/&gt;
                                              &lt;c:set var=&quot;zrs&quot; value =&quot;zeros(this,${dto.valMaxChamp},'${nomDuChamp}',${indexDto});&quot;/&gt;
                                              &lt;input &lt;c:out value=&quot;${optionChampInterdit}&quot;/&gt; type=&quot;text&quot; name=&quot;dto[&lt;c:out value=&quot;${indexDto}&quot;/&gt;].valeurSaisiForm&quot; onfocus=&quot;change_classe_byId(this,'on');&quot;
                                              onclick=&quot;SetSelectedControl(this,'&lt;%= nomDuChamp %&gt;');&quot; style=&quot;&lt;%=style%&gt;&quot; maxlength=&quot;&lt;%=max%&gt;&quot; 
                                              onblur=&quot;&lt;c:out value=&quot;${zrs}&quot;/&gt;;change_classe_byId(this,'off');&quot; onchange=&quot;&lt;c:out value=&quot;${prop}&quot;/&gt;&quot; onkeyup=&quot;&lt;c:out value=&quot;${prop}&quot;/&gt;&quot; class=&quot;&lt;c:out value=&quot;${styleClass}&quot;/&gt;&quot;  value=&quot;&lt;c:out value=&quot;${dto.valeurSaisiForm}&quot;/&gt;&quot; /&gt;
      &lt;/c:when&gt;
      &lt;c:otherwise&gt;
                                              &lt;input &lt;c:out value=&quot;${optionChampInterdit}&quot;/&gt; type=&quot;text&quot; id=&quot;&lt;c:out value=&quot;${dto.nomChamp}&quot;/&gt;&quot; name=&quot;dto[&lt;c:out value=&quot;${indexDto}&quot;/&gt;].valeurSaisiForm&quot; onfocus=&quot;change_classe_byId(this,'on');&quot;
                                              onclick=&quot;SetSelectedControl(this,'&lt;%= nomDuChamp %&gt;');&quot; style=&quot;&lt;%=style%&gt;&quot; maxlength=&quot;&lt;%=max%&gt;&quot; 
                                              onblur=&quot;&lt;c:out value=&quot;${zrs}&quot;/&gt;;change_classe_byId(this,'off');&quot;   class=&quot;&lt;c:out value=&quot;${styleClass}&quot;/&gt;&quot;  value=&quot;&lt;c:out value=&quot;${dto.valeurSaisiForm}&quot;/&gt;&quot; /&gt; 
                                                      
                                              
      &lt;/c:otherwise&gt;
                                      
  &lt;/c:choose&gt;
  </code></pre>
  <p>Functions :</p>
  <pre><code>function calculer(obj, max,field, indexTmp){
              var nameTmp = &quot;tmpValue[&quot;+indexTmp+&quot;]&quot;;
              if(obj!=null &amp;&amp; ((obj.value.length== max) || (obj.value.length== 0)) &amp;&amp; this.document.Bean.elements[nameTmp]!=null &amp;&amp;
                     this.document.Bean.elements[nameTmp].value!=obj.value){
                  this.document.Bean.elements[nameTmp].value = obj.value;
              setTemplate(field);
              }
  
          }
      
      function zeros(obj, max, field,indexTmp)
      {
          alert(&quot;Inside Zeros - onBlur Called----Current Value is &quot;+obj.value);
                  
      
          var nameTmp = &quot;tmpValue[&quot;+indexTmp+&quot;]&quot;;
          
          if (field.substring(0,8) == &quot;PDPMODEL&quot;)     
          {
              alert(&quot;Field is PDPMODEL&quot;);
              if(obj!=null &amp;&amp; obj.value.length &lt; max &amp;&amp; obj.value.length != 0 &amp;&amp; this.document.Bean.elements[nameTmp]!=null)
              {
              
                  alert(&quot;Zeros Prefix Needed&quot;);
                  var prfx=&quot;&quot;;
                  for(var cnt= obj.value.length; cnt &lt; max ; cnt++)
                  {
                      prfx=prfx+&quot;0&quot;;
                  }
                  
                  obj.value = prfx + obj.value;
                  alert(&quot;New value is &quot;+obj.value);
                  
                  this.document.Bean.elements[nameTmp].value = obj.value;
                  setTemplate(field);
          
                  
              }
              change_classe_byId(obj,'off');
              
          }
          
          change_classe_byId(obj,'off');
          
      }
  </code></pre>