More validation fixes

This commit is contained in:
swag 2023-05-09 21:21:58 -04:00
parent 697eebdc3a
commit e800d9a600
2 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,8 @@
<%= text_field author => session->{'author'}, ( <%= text_field author => session->{'author'}, (
id => 'author', id => 'author',
maxlength => 63, maxlength => 63,
minlength => 1 minlength => 1,
required => undef
) %> ) %>
<% if (my $error = validation->error('author')) { =%> <% if (my $error = validation->error('author')) { =%>
<p class="field-with-error">Invalid author: 1 to 63 characters please.</p> <p class="field-with-error">Invalid author: 1 to 63 characters please.</p>

View File

@ -7,7 +7,8 @@
<%= text_field author => session->{'author'}, ( <%= text_field author => session->{'author'}, (
id => 'author', id => 'author',
maxlength => 63, maxlength => 63,
minlength => 1 minlength => 1,
required => undef
) %> ) %>
<% if (my $error = validation->error('author')) { =%> <% if (my $error = validation->error('author')) { =%>
<p class="field-with-error">Invalid author: 1 to 63 characters please.</p> <p class="field-with-error">Invalid author: 1 to 63 characters please.</p>
@ -19,7 +20,8 @@
id => 'title', id => 'title',
maxlength => 127, maxlength => 127,
minlength => 1, minlength => 1,
autofocus => undef autofocus => undef,
required => undef
) %> ) %>
<% if (my $error = validation->error('title')) { =%> <% if (my $error = validation->error('title')) { =%>
<p class="field-with-error">Invalid title: 1 to 127 characters please.</p> <p class="field-with-error">Invalid title: 1 to 127 characters please.</p>
@ -31,7 +33,7 @@
id => 'body', id => 'body',
maxlength => 4000, maxlength => 4000,
minlength => 2, minlength => 2,
required => 'true', required => undef,
rows => 6 rows => 6
) %> ) %>
<% if (my $error = validation->error('body')) { =%> <% if (my $error = validation->error('body')) { =%>