Bugzilla – Attachment 62442 Details for
Bug 10267
No error message when entering an invalid cardnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10267: Show error message if user tries to enter too many characters for cardnumber
Bug-10267-Show-error-message-if-user-tries-to-ente.patch (text/plain), 4.56 KB, created by
Marc Véron
on 2017-04-20 06:16:04 UTC
(
hide
)
Description:
Bug 10267: Show error message if user tries to enter too many characters for cardnumber
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-04-20 06:16:04 UTC
Size:
4.56 KB
patch
obsolete
>From 11f58a3ab2708696559e95f2043db0c633491e82 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 20 Apr 2017 03:35:47 +0000 >Subject: [PATCH] Bug 10267: Show error message if user tries to enter too many > characters for cardnumber >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch displays a message if the user tries to enter more than the >max number of characters for a cardnumber. > >To test: >1) Apply patch and go to Patrons -> New patron >2) Scroll down to Card number >3) Put in any characters. Notice that when you have entered the max >number of characters, you are unable to type any more. >4) If you try to type again, the error message will show up. >5) if you backspace some characters, the message should disappear > >Sponsored-by: Catalyst IT > >Followed test plan, works as expected >Signed-off-by: Marc Véron <veron@veron.ch> >--- > .../prog/en/modules/members/memberentrygen.tt | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index ff3ef68..7d825b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -36,7 +36,15 @@ $(document).ready(function() { > }); > > $(document).ready(function() { >- >+ $("#cn_max").hide(); >+ var max_len = [% maxlength_cardnumber %]; >+ $("#cardnumber").keypress(function(){ >+ if ( $("#cardnumber").val().length == max_len ) { >+ $("#cn_max").show(); >+ } else { >+ $("#cn_max").hide(); >+ } >+ }); > var toggle_quick_add = $(".toggle_quick_add"); > $(toggle_quick_add).click(function(e){ > toggle_quick_add.toggle(); >@@ -613,19 +621,19 @@ $(document).ready(function() { > [% END %] > [% IF minlength_cardnumber == maxlength_cardnumber %] > <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" /> >- [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %] >+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber %] characters.</span> > <div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div> > [% ELSIF minlength_cardnumber && maxlength_cardnumber %] > <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" /> >- [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %] >+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber %] characters.</span> > <div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div> > [% ELSIF maxlength_cardnumber %] > <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" maxlength="[% maxlength_cardnumber %]" /> >- [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %] >+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber %] characters.</span> > <div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div> > [% ELSE %] > <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber | html %]" /> >- [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %] >+ [% IF mandatorycardnumber and not autoMemberNum %]<span class="required">Required</span>[% END %]<span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber %] characters.</span> > <div class="hint">There is no minimum or maximum character length.</div> > [% END %] > </li> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10267
:
62440
|
62442
|
62806
|
62934
|
65657
|
66732
|
68503
|
68504
|
68724
|
68725