<& /elements/header.html, mt('Preferences for [_1]', $FS::CurrentUser::CurrentUser->username) &>
+% my $js_form_validate = { 'pref_form' => { 'name' => 'pref_form' } };
+
<FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
<& /elements/error.html &>
</TD>
</TR>
- <TR>
- <TH ALIGN="right"><% emt('Hide notification of new ticket activity') %></TH>
- <TD ALIGN="left">
- <INPUT TYPE="checkbox" NAME="hide_notify_tickets" VALUE="1" <% $curuser->option('hide_notify_tickets') ? 'CHECKED' : '' %>>
- </TD>
- </TR>
-
<TR>
<TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
<TD ALIGN="left" COLSPAN=2>
</TD>
</TR>
+% my $validate_field_cve = 'customer_view_emails';
+% $js_form_validate->{pref_form}->{validate_fields}{$validate_field_cve} = 'digits: true';
+% $js_form_validate->{pref_form}->{error_message}{$validate_field_cve} = 'Please only enter numbers here.';
+
<TR>
<TH ALIGN="right"><% emt("How many recent outbound emails to show in customer view") %></TH>
<TD ALIGN="left" COLSPAN=2>
- <INPUT TYPE="text" NAME="customer_view_emails" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
+ <INPUT TYPE="text" ID="<% $validate_field_cve %>" NAME="<% $validate_field_cve %>" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
</TD>
</TR>
<INPUT TYPE="submit" VALUE="<% emt("Update preferences") %>">
-<&/elements/footer.html &>
+% my %footerdata = (
+% 'formvalidation' => $js_form_validate,
+% );
+<% include("/elements/footer.html", %footerdata) %>
+
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;