Skip to content

Commit ab4715e

Browse files
authored
Add in the DOW crawler documentation code sample to show how to tick checkboxes
1 parent 5151707 commit ab4715e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/dom_crawler.rst

+8
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ To work with multi-dimensional fields::
482482
<input name="multi[]"/>
483483
<input name="multi[]"/>
484484
<input name="multi[dimensional]"/>
485+
<input name="multi[dimensional][]" value="1"/>
486+
<input name="multi[dimensional][]" value="2"/>
487+
<input name="multi[dimensional][]" value="3"/>
485488
</form>
486489

487490
Pass an array of values::
@@ -495,6 +498,11 @@ Pass an array of values::
495498
'dimensional' => 'an other value',
496499
]]);
497500

501+
// tick multiple checkboxes at once
502+
$form->setValues(['multi' => [
503+
'dimensional' => [1, 3] // it uses the input value to determine which checkbox to tick
504+
]]);
505+
498506
This is great, but it gets better! The ``Form`` object allows you to interact
499507
with your form like a browser, selecting radio values, ticking checkboxes,
500508
and uploading files::

0 commit comments

Comments
 (0)