title: changing validation group of button with javascript on client side
body: <p>In a form I have multiple group of controls which are grouped using validation group property. I want to assign validation group to asp.Button dynamically on client side using javascript on the base of item selected in drop down list.</p>
  
  <p>Here is JavaScript which I am using, but it is not working. It shows validation group undefined but actually a default group is defined.</p>
  
  <p>Please advice me. thanks</p>
  
  <pre><code>&lt;script type="text/JavaScript"&gt;
  
  function NextClicked() {  
  
    var _ddlStatus = document.getElementById("&lt;%=ddl.ClientID%&gt;");
  
    var _selectedIndex = _ddlStatus.selectedIndex;
  
    var _btn = document.getElementById("&lt;%=btnNext.ClientID%&gt;");
  
  
    alert(_btn.ValidationGroup); // here in messge it shows undefiend, yet I have defiend a group in button as default.  
  
  
    if (_selectedIndex == 1) {
  
      _btn.ValidationGroup = "G1";
  
    }
  
    else
  
      if (_selectedIndex == 2) {
        _btn.ValidationGroup = "G2";       
    }
  }
  </code></pre>
  
  <p>    </p>