Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8173527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:11:22+00:00 2026-06-06T22:11:22+00:00

Consider the following Mechanize form object #<Mechanize::Form {name f1} {method POST} {action f.php} {fields

  • 0

Consider the following Mechanize form object

#<Mechanize::Form
 {name "f1"}
 {method "POST"}
 {action "f.php"}
 {fields
  [hidden:0x4db4b02 type: hidden name: opflag value: ]
  [text:0x4db463e type: text name: lno value: 666]
  [selectlist:0x4db84dc type:  name: scode value: []]}
 {radiobuttons}
 {checkboxes}
 {file_uploads}
 {buttons [button:0x4db42ec type: button name: bt value:  Show Result ]}>

Here, I am able to set value of text field using

result_form = page.form('f1')
result_form.lno = '666'

But I am facing difficulty in setting value for scode selectlist. I have tried

result_form.field_with(name:"scode").option_with(value: "foo").click

it returns an ERROR as
undefined methodclick’ for nil:NilClass (NoMethodError)`
then, I tried

result_form.scode.value = 'foo'

But this returns NoMethodError as well. Any idea how to set value for selectlist in Mechanize?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:11:32+00:00Added an answer on June 6, 2026 at 10:11 pm

    Try just:

    result_form.scode = 'foo'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider following schema: Customers: Col | Type | -------------------| id | INTEGER | name
Consider the following public method that adds an integer variable to a vector of
How to get the underlying type of an Observable collection using reflection? Consider following
Consider following situation: Object > MyClass > MyClassA, MyClassB If I want something in
Consider the following scenario. I am clicking the submit button of a JSF form,
Consider the following: object Main { case class Foo(bar: Int) extends FooList { val
Consider the following code: // this method should add numbers, the requirements are: //
Based on: MVC Html.CheckBox and form submit issue Let's consider following example. View: <%
Consider following object, object A { def setX(x:Int) = { val x1 = x
Consider following make: all: a b a: echo a exit 1 b: echo b

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.