Closed Tekki closed 5 years ago
Thanks for this, very helpful. Ignoring these :wink:, p
should be an array i.e. p=P0&p=P1
in the two submit cases. I think I have a fix.
If we make an array the main question is if the order of the parameters is preserved. I'll have to check this against a real world application and probably have no time before the week end. In any case this module already looks much better than HTML::Form! And it's a good example about how to use roles.
I've been looking at this, this and submit spec. Tree order is mentioned there, as is default button, which I also made edits to today. For the submit button value, around val
never calls $self->$orig(@args)
, because the following is different to Mojo::DOM->val
. I guess really it should adjust locale/gettext...
Quick test at https://www.w3schools.com/html/tryit.asp?filename=tryhtml_elem_datalist with following content seems like order is tree order.
<!DOCTYPE html>
<html>
<body>
<form action="/action_page.php">
<input name=p value=P0 type=hidden />
<input type="submit" name=p value=P1 />
<input name=p value=2P type=hidden />
</form>
</body>
</html>
Here are some failing tests for #3. I've added a hidden field with name 'p' and a second submit button with the same name. Submit the form without clicking a button should return
p = P0
, click on the first buttonp = P1
and click on the secondp = P2
.