Skip to content

Commit

Permalink
use id attributes in form examples (closes #932)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 8, 2016
1 parent 715d528 commit 48c1531
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -842,16 +842,16 @@ logic with methods like L<Mojolicious::Validator::Validation/"is_valid">.
%= form_for index => begin
%= label_for user => 'Username (required, 1-20 characters, only e-t)'
<br>
%= text_field 'user'
%= text_field 'user', id => 'user'
%= submit_button
<br>
%= label_for pass => 'Password (optional, 7-500 characters)'
<br>
%= password_field 'pass'
%= password_field 'pass', id => 'pass'
<br>
%= label_for pass_again => 'Password again (equal to the value above)'
<br>
%= password_field 'pass_again'
%= password_field 'pass_again', id => 'pass_again'
% end
</body>
</html>
Expand Down Expand Up @@ -964,7 +964,7 @@ L<Mojolicious::Validator::Validation/"csrf_protect">.
%= form_for target => begin
%= csrf_field
%= label_for city => 'Which city to point low orbit ion cannon at?'
%= text_field 'city'
%= text_field 'city', id => 'city'
%= submit_button
%= end
</body>
Expand Down
8 changes: 4 additions & 4 deletions t/mojolicious/tag_helper_lite_app.t
Expand Up @@ -144,11 +144,11 @@ EOF
$t->get_ok('/basicform')->status_is(200)->content_is(<<EOF);
<form action="/links">
<label for="foo">&lt;Foo&gt;</label>
<input name="foo" type="text" value="bar">
<input id="foo" name="foo" type="text" value="bar">
<label for="bar">
Bar<br>
</label>
<input class="test" name="bar" type="text" value="baz">
<input class="test" id="bar" name="bar" type="text" value="baz">
<input name="yada" type="text" value="">
<input class="tset" name="baz" value="yada">
<input type="submit" value="Ok">
Expand Down Expand Up @@ -568,11 +568,11 @@ __DATA__
@@ basicform.html.ep
%= form_for links => begin
%= label_for foo => '<Foo>'
%= text_field foo => 'bar'
%= text_field foo => 'bar', id => 'foo'
%= label_for bar => begin
Bar<br>
%= end
%= text_field bar => 'baz', class => 'test'
%= text_field bar => 'baz', class => 'test', id => 'bar'
%= text_field yada => ''
%= input_tag baz => 'yada', class => 'tset'
%= submit_button
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/validation_lite_app.t
Expand Up @@ -352,12 +352,12 @@ __DATA__
% }
%= form_for index => begin
%= label_for foo => '<Foo>', class => 'custom'
%= text_field 'foo', class => 'custom'
%= text_field 'foo', class => 'custom', id => 'foo'
%= text_area 'bar'
%= label_for baz => (class => 'custom') => begin
Baz
% end
%= select_field baz => [qw(yada yada)]
%= select_field baz => [qw(yada yada)], id => 'baz'
%= password_field 'yada'
% end
Expand Down

0 comments on commit 48c1531

Please sign in to comment.