title: how to display validation summary of an asp.net page using Javascript
body: <p>I have one asp.net form.<br/>
  In it i have many fields which are required.<br/>
  I want to display validation summary of all fields at the end of the form.<br/>
  I have already checked for valid values of input controls.<br/>
  Now i only want is Summary.<br/></p>
  
  <p>Here is my code for valid data input</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
          function userCheck(uName) {
              var uName = document.getElementById(uName);
              var letters = /^[A-Za-z0-9]+$/;
              if (uName.value.match(letters) &amp;&amp; uName.value.length != 0) {
                  uName.style.border = "2px solid #008A2E";
                  return true;
              }
              else {
                  uName.value = uName.value.replace(/[\W]/g, '');
                  uName.style.border = "2px solid #ff0000";
                  uName.focus();
                  return false;
              }
          }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is just one function for username check.<br/>
  I have many more to deal with.<br/>
  Is there any way to display summary from all fields at the last when submit button is pressed ?
  <br/>
  below solution is not working.<br/></p>
  
  <pre><code> function ddlcheck(ddlclg) {
              var clg = document.getElementById(ddlclg.id);
              var clgname = document.getElementById('&lt;%= LblCollegeName.ClientID %&gt;');
              clgname.style.display = "block";
              clgname.innerHTML = "Selected College : " + clg.options[clg.selectedIndex].value;
              clg.style.border = "1px solid #008A2E";
              if (clg.options[clg.selectedIndex].value == "Select") {
                  clgname.style.display = "none";
                  clg.style.border = "1px solid #ff0000";
                  validationhtml = validationhtml + "&lt;b&gt;*&lt;/b&gt; College" + "&lt;/br&gt;";
              }
          }
  </code></pre>
  
  <p>above code is for dropdownlist.<br/></p>
  
  <pre><code> function select() {
              var count = 0;
              var chkSelectAll = document.getElementById('&lt;%= ChkSelectAll.ClientID %&gt;');
              var chkList = document.getElementById('&lt;%= chk.ClientID %&gt;').getElementsByTagName("input");
              for (var i = 0; i &lt; chkList.length; i++) {
                  if (chkList[i].checked == true) {
                      count++;
                  }
              }
              if (count == chkList.length)
                  chkSelectAll.checked = true;
              else {
                  chkSelectAll.checked = false;
              }
          }
  </code></pre>
  
  <p>above code is for selected check boxes.<br/></p>