Hidden fields disregarded normal?
georaldc opened this issue · comments
Is it normal behavior for hidden fields to be disregarded when using Goutte? I normally have checkboxes paired with hidden fields that use the same name to act as a default value for unchecked form elements but this doesn't work well with mink + goutte. Calling uncheck() on a checkbox field works fine but the hidden element with the same name as the unchecked element doesn't get carried over as a POST value upon submission.
So I was a bit wrong there. Did a little more testing and in my project, it only drops the hidden field when it comes before an unticked checkbox of the same name
<input type="hidden" name="foobar" value="foo" />
<input type="checkbox" name="foobar" value="bar" />
This works fine by the way in a browser (and with something like the selenium driver)
The Symfony DomCrawler component does not allow having both a hidden field and a checkbox with the same name. So this means we cannot support it in Mink drivers based on top of it.
This is kind of related to symfony/symfony#11689 (the fatal error reported there was fixed, but it still does not support submitting the hidden field)
I see. I guess there's nothing I can do right now (other than changing my code or using a different driver). Anyway, I think this can be closed and I can just ask any further, related questions at the symfony repo. Thanks