title: Issue regarding ruby mechanize
body: <p>I want to login into a web portal.There is a form .But the main problem is that there are two submit buttons in the form. One with  value "Normal Login" and another with value "Special Login for utilisation".Now I want to submit the form using the button with "Normal Login" value.</p>
  
  <p>My ruby code is:-</p>
  
  <pre><code>require 'rubygems'
  require 'mechanize'
  
  agent = Mechanize.new
  
  page = agent.get('http://egov.wbcomtax.gov.in/DematWaybill/index.jsp')
  pp page                     #The page view for first time
  
  login_section= page.forms.first
  user_id_value= login_section.field_with(name: "txtUserID")
  user_id_value.value="******" 
  password_value=login_section.field_with(name: "txtPassword")
  password_value.value="*********"
  
  pp user_id_value
  pp password_value
  
  home_page=login_section.submit(login_section.button_with(:value=&gt;'Normal Login'))
  
  pp home_page                 #printing the same page 
  </code></pre>
  
  <p>Now when I use the line home_page=login_section.submit(login_section.button_with(:value=>'Normal Login')) it is throwing error.</p>
  
  <p>Please tell me how to do it.</p>
  
  <p>The form is:</p>
  
  <pre><code>&lt;form name="frmLogin" method="post"&gt;
   &lt;input type="text" class="textboxc" id="txtUserID3" name="txtUserID"&gt; 
   &lt;input class="textboxc" id="txtPassword" type="password" name="txtPassword" /&gt;
  &lt;input type="submit" name="Submit" value="Normal Login" onclick="return check_user()"&gt;
  &lt;input type="Submit" value="Special Login for utilisation" onclick="return check_user2()"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Please help me.Thank you in advance.</p>
  
  <p>It is showing the page data once again. I have mentioned pp page in my code and then metioned pp home_page. Both are printing same</p>
  
  <p>Here is my terminal view:</p>
  
  <pre><code>C:\Ruby22\code&gt;ruby actual_machine_test.rb
  #&lt;Mechanize::Page
  {url #&lt;URI::HTTP http://egov.wbcomtax.gov.in/DematWaybill/index.jsp&gt;}
  {meta_refresh}
  {title "DEMATERIALIZED WAYBILL- Login."}
  {iframes}
  {frames}
  {links
  #&lt;Mechanize::Page::Link "" "idforpassword.jsp"&gt;
  #&lt;Mechanize::Page::Link "" "http://www.wb.nic.in/"&gt;
  #&lt;Mechanize::Page::Link "" "http://wbcomtax.gov.in/link.htm"&gt;
  #&lt;Mechanize::Page::Link "" "http://wbcomtax.gov.in/disclaimer.htm"&gt;}
  {forms
   #&lt;Mechanize::Form
   {name "frmLogin"}
   {method "POST"}
   {action "http://egov.wbcomtax.gov.in/DematWaybill/index.jsp"}
   {fields
    [text:0x1f10260 type: text name: txtUserID value: ]
    [field:0x2867f84 type: password name: txtPassword value: ]}
    {radiobuttons}
    {checkboxes}
    {file_uploads}
    {buttons
    [submit:0x2867e58 type: submit name: Submit value: Normal Login]
    [submit:0x2867cc8 type: Submit name:  value: Special Login for  utilisation]}&gt;}&gt;
    [text:0x1f10260 type: text name: txtUserID value: MARK5705]
    [field:0x2867f84 type: password name: txtPassword value: mark*008]
  
  
    #&lt;Mechanize::Page
    {url #&lt;URI::HTTP http://egov.wbcomtax.gov.in/DematWaybill/index.jsp&gt;}
    {meta_refresh}
    {title "DEMATERIALIZED WAYBILL- Login."}
    {iframes}
    {frames}
    {links
    #&lt;Mechanize::Page::Link "" "idforpassword.jsp"&gt;
    #&lt;Mechanize::Page::Link "" "http://www.wb.nic.in/"&gt;
    #&lt;Mechanize::Page::Link "" "http://wbcomtax.gov.in/link.htm"&gt;
    #&lt;Mechanize::Page::Link "" "http://wbcomtax.gov.in/disclaimer.htm"&gt;}
    {forms
    #&lt;Mechanize::Form
    {name "frmLogin"}
    {method "POST"}
    {action "http://egov.wbcomtax.gov.in/DematWaybill/index.jsp"}
    {fields
    [text:0x28ea54c type: text name: txtUserID value: ]
    [field:0x28ea3f8 type: password name: txtPassword value: ]}
     {radiobuttons}
     {checkboxes}
     {file_uploads}
     {buttons
     [submit:0x28ea2cc type: submit name: Submit value: Normal Login]
     [submit:0x28ea13c type: Submit name:  value: Special Login for utilisation]}&gt;}&gt;
     ................................
  </code></pre>