Bugzilla – Attachment 65657 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]
[SIGNED OFF] Bug 10267: Show error message if user tries to enter too many characters for cardnumber
SIGNED-OFF-Bug-10267-Show-error-message-if-user-tr.patch (text/plain), 4.28 KB, created by
Katrin Fischer
on 2017-08-08 16:05:19 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 10267: Show error message if user tries to enter too many characters for cardnumber
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2017-08-08 16:05:19 UTC
Size:
4.28 KB
patch
obsolete
>From d13d203b824ae941163e00b13c709281d0defba6 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 20 Apr 2017 03:35:47 +0000 >Subject: [PATCH] [SIGNED OFF] 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) Click out of the text field (so it loses focus), the error message will show up. >5) if you backspace some characters and click out of the text field >again, the message should disappear > >Sponsored-by: Catalyst IT > >Followed test plan, works as expected >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/members/memberentrygen.tt | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 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 7f6f734..6e94dfd 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").change(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(); >@@ -611,15 +619,15 @@ $(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 %]" /> >-- >2.7.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