title: Javascript on submit click
body: <p>i am trying to show a div on click of a submit button but when i am submitting the div is shown for the moment till the page reloads. after the page reload the div fades away.i need to stop that fading.how to do it in javascript.
  the code is as:</p>
  
  
            
            <h2></h2>
            
            
            All
           
             
            <br><br>
            
            
            Linkages
            Total No. of records
            <br><br>
            Search
            
  
  <pre><code>      &lt;div class="child" id="p2" style="display:none" data-dojo-type="dijit/TitlePane" data-dojo-props="title: 'Result'"&gt;
        &lt;%     String a1=fa.getsrc();
              String name=request.getParameter("sel");
              String src=request.getParameter("linkrec");%&gt;
              The Selected source is ---&gt;&lt;%=name %&gt;&lt;br&gt;&lt;br&gt;
          &lt;b&gt;The Selected operation is--&gt;&lt;%=src %&gt;&lt;/b&gt;&lt;br&gt;
          &lt;b&gt;The Source &lt;%=name%&gt; Has &lt;%=src%&gt;---&gt;&lt;%=a1%&gt;&lt;/b&gt;
  
          &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>      function check()
        {
            usersrc=document.getElementById("sel").value;
            userselect=document.getElementById("linkrec").value;
  
           if(usersrc=="&lt;---Select the Sources---&gt;"|| userselect=="&lt;---Select The Operation---&gt;")
                {
                alert("Select src and records");
                }
          else if (usersrc=="All" &amp;&amp; userselect=="Linkages")
               {
               document.getElementById('p2').style.display ='';
               }&lt;/script&gt;
  </code></pre>