lib/mechanize/form.rb in mechanize-0.6.3 vs lib/mechanize/form.rb in mechanize-0.6.4

- old
+ new

@@ -116,20 +116,22 @@ # Find all input tags (@elements_node/'input').each do |node| node.attributes ||= {} type = (node.attributes['type'] || 'text').downcase name = node.attributes['name'] - next if type != 'submit' && name.nil? + next if name.nil? && !(type == 'submit' || type =='button') case type when 'text', 'password', 'hidden', 'int' @fields << Field.new(node.attributes['name'], node.attributes['value'] || '') when 'radio' @radiobuttons << RadioButton.new(node.attributes['name'], node.attributes['value'], node.attributes.has_key?('checked'), self) when 'checkbox' @checkboxes << CheckBox.new(node.attributes['name'], node.attributes['value'], node.attributes.has_key?('checked'), self) when 'file' @file_uploads << FileUpload.new(node.attributes['name'], nil) when 'submit' + @buttons << Button.new(node.attributes['name'], node.attributes['value']) + when 'button' @buttons << Button.new(node.attributes['name'], node.attributes['value']) when 'image' @buttons << ImageButton.new(node.attributes['name'], node.attributes['value']) end end