title: jqgrid AfterShowForm event
body: <p>I have a jqGrid with a function "MyFunction" in AfterShowForm event.</p>
  
  <pre><code>MyFunction= function() {
   alert("#MyElementId");
   $("#MyElementId").attr("disabled", "true");
  }
  </code></pre>
  
  <p>The code above works, but if I remove the alert does not work!!</p>
  
  <p>Why?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The HTML code is:</p>
  
  <pre><code>&lt;div id="editcntgridVisualizzazioni" class="ui-jqdialog-content ui-widget-content"&gt;
      &lt;span&gt;
          &lt;form name="FormPost" id="FrmGrid_gridVisualizzazioni" class="FormGrid" onsubmit="return false;" style="width:100%;overflow:auto;position:relative;height:auto;"&gt;
              &lt;table id="TblGrid_gridVisualizzazioni" class="EditTable" border="0" cellpadding="0" cellspacing="0"&gt;
                  &lt;tbody&gt;
                      &lt;tr id="FormError" style="display:none"&gt;
                          &lt;td class="ui-state-error" colspan="2"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr style="display:none" class="tinfo"&gt;
                          &lt;td class="topinfo" colspan="2"&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr id="tr_AggregazioniDatiDesc" class="FormData" rowpos="1"&gt;
                          &lt;td class="CaptionTD"&gt;Agrégation&lt;/td&gt;
                          &lt;td class="DataTD"&gt;&amp;nbsp;
                              &lt;select disabled="disabled" name="AggregazioniDatiDesc" id="AggregazioniDatiDesc" maxlength="128" class="FormElement" role="select"&gt;
                                  &lt;option role="option" value=""&gt;&lt;/option&gt;
                                  &lt;option role="option" value="1"&gt;Aucune&lt;/option&gt;
                                  ....
                              &lt;/select&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
  ....
  </code></pre>
  
  <p>where "AggregazioniDatiDesc" is MyElementId</p>
  
  <p>The above code is created from jqgrid in the editing form...</p>
  
  <p>If I don't put the alert, the  element doesn't have attribute disabled="disabled"...</p>