I have a simple php form and I would like to select the radio button using multimechanize, I'm able to select fill the text fields, but I'm not sure how to work with radio buttons or checkboxes...
I tried the following but it doesn't work
# select first (zero-based) form on page
br.select_form(nr=0)
# set form field
br.form['name'] = 'foo'
br.form['email'] = 'foo@foo.com'
br.form['gender'] = 'male'
<form method="post" action="/mechanize/index.php">
Name: <input type="text" name="name" value="">
<span class="error">* </span>
<br><br>
E-mail: <input type="text" name="email" value="">
<span class="error">* </span>
<br><br>
Website: <input type="text" name="website" value="">
<span class="error"></span>
<br><br>
Comment: <textarea name="comment" rows="5" cols="40"></textarea>
<br><br>
Gender:
<input type="radio" name="gender" value="female">Female
<input type="radio" name="gender" value="male">Male
<span class="error">* </span>
<br><br>
<input type="submit" name="submit" value="Submit">
</form>