Skip to content

Add in the DOM crawler documentation code sample to show how to tick checkboxes #12121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ To work with multi-dimensional fields::
<input name="multi[]"/>
<input name="multi[]"/>
<input name="multi[dimensional]"/>
<input name="multi[dimensional][]" value="1"/>
<input name="multi[dimensional][]" value="2"/>
<input name="multi[dimensional][]" value="3"/>
</form>

Pass an array of values::
Expand All @@ -495,6 +498,11 @@ Pass an array of values::
'dimensional' => 'an other value',
]]);

// tick multiple checkboxes at once
$form->setValues(['multi' => [
'dimensional' => [1, 3] // it uses the input value to determine which checkbox to tick
]]);

This is great, but it gets better! The ``Form`` object allows you to interact
with your form like a browser, selecting radio values, ticking checkboxes,
and uploading files::
Expand Down