0

I have an issue with radio field.

echo $form->field($member_model, ‘gender’)->radio(array(‘label’=>”,’value’=>’M’,’id’=>’left’))->label(‘Male’);
echo $form->field($member_model, ‘gender’)->radio(array(‘label’=>”,’value’=>’F’,’id’=>’right’))->label(‘Female’);

I have the above radio fields with Male selected by default. And in my acceptance code: $this->actor->selectOption(‘input[name=”Membersinfo[gender]”]’, ‘M’);

But,

Couldn’t select option “input[name=”Membersinfo[gender]”]”,”M”: InvalidArgumentException: Input “Membersinfo[gender]” cannot take “M” as a value (possible values: F)

1 Answer 1

0

Maybe this code help you!

$this->actor->selectOption('//input[@name="Membersinfo[gender]"]', 'M');

I tested with this sample listed bellow:

$I->selectOption('//input[@name="Membersinfo[gender]"]', 'M');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.