title: Using Mechanize to submit a form for web-automation - returning an error
body: <pre><code>for control in form.controls:
  
          if control.type == 'text':
              if 'user' in control.name:
                  control.value = 'blah'
              if 'mail' in control.name:
                  control.value = 'blah'
  
          if control.type == 'password':
              if 'pass' in control.name:
                  control.value = 'blah'
  
          if control.type == 'checkbox':
              if 'agree' in control.name:
                  control.selected = True
  
          if control.type == 'submit':
              if 'Submit' in control.name:
                  control.readonly = False
  </code></pre>
  
  <p>I fill the form out this way. Then I go to selected the "Agree" checkbox, after doing that I try to use br.submit() to submit the form and send the data. The error I get it:</p>
  
  <p>AttributeError: SubmitControl instance has no attribute 'click'</p>
  
  <p>This is the HTML source of the submit and agree controls:</p>
  
  <pre><code>&lt;input type="submit" name="regSubmit" value="Register" /&gt;
  &lt;label for="regagree"&gt;&lt;input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /&gt; &lt;b&gt;I Agree&lt;/b&gt;&lt;/label&gt;
  </code></pre>
  
  <p>The HTML source of this particular website has this JavaScript:</p>
  
  <pre><code>function verifyAgree()
  {
      if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
      {
          alert("The two passwords you entered are not the same!");
          return false;
      }
  
      if (!document.forms.creator.regagree.checked)
      {
          alert("Please read and accept the agreement before registering.");
          return false;
      }
  
      return true;
  }
  function checkAgree()
  {
      document.forms.creator.regSubmit.disabled = isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.email) || isEmptyText(document.forms.creator.passwrd1) || !document.forms.creator.regagree.checked;
      setTimeout("checkAgree();", 1000);
  }
  setTimeout("checkAgree();", 1000);
  </code></pre>
  
  <p>When I type print forms into IDLE, the form is returned as filled and all the proper controls are selected. I can't for the life of me figure out WHY this isn't working. I've been at it for two days.</p>
  
  <p>Help is greatly appreciated.</p>