View | Details | Raw Unified | Return to bug 22594
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc (-1 / +2 lines)
Lines 16-22 $(document).ready(function(){ Link Here
16
        rangelength: $.validator.format(_("Please enter a value between {0} and {1} characters long.")),
16
        rangelength: $.validator.format(_("Please enter a value between {0} and {1} characters long.")),
17
        range: $.validator.format(_("Please enter a value between {0} and {1}.")),
17
        range: $.validator.format(_("Please enter a value between {0} and {1}.")),
18
        max: $.validator.format(_("Please enter a value less than or equal to {0}.")),
18
        max: $.validator.format(_("Please enter a value less than or equal to {0}.")),
19
        min: $.validator.format(_("Please enter a value greater than or equal to {0}."))
19
        min: $.validator.format(_("Please enter a value greater than or equal to {0}.")),
20
        phone: $.validator.format(_("Please enter a valid phone number."))
20
    });
21
    });
21
});
22
});
22
//]]>
23
//]]>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+1 lines)
Lines 1096-1101 Link Here
1096
    [% IF ( SMSSendDriver ) %]
1096
    [% IF ( SMSSendDriver ) %]
1097
        <p><label for="SMSnumber">SMS number:</label>
1097
        <p><label for="SMSnumber">SMS number:</label>
1098
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1098
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1099
            <span class="hint">SMS number should be in the format 1234567890 or +11234567890</span>
1099
        </p>
1100
        </p>
1100
        [% UNLESS nosms_provider_id %]
1101
        [% UNLESS nosms_provider_id %]
1101
        <p>
1102
        <p>
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (+12 lines)
Lines 309-314 $(document).ready(function(){ Link Here
309
        write_age();
309
        write_age();
310
    }
310
    }
311
311
312
    $.validator.addMethod(
313
        "phone",
314
        function(value, element, phone) {
315
            var e164 = "^\\+?[1-9]\\d{1,14}$";
316
            var re = new RegExp(e164);
317
            return this.optional(element) || re.test(value);
318
        },
319
        jQuery.validator.messages.phone);
320
312
    $("#entryform").validate({
321
    $("#entryform").validate({
313
        rules: {
322
        rules: {
314
            email: {
323
            email: {
Lines 326-331 $(document).ready(function(){ Link Here
326
            },
335
            },
327
            password2: {
336
            password2: {
328
               password_match: true
337
               password_match: true
338
            },
339
            SMSnumber: {
340
               phone: true,
329
            }
341
            }
330
        },
342
        },
331
        submitHandler: function(form) {
343
        submitHandler: function(form) {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-2 / +1 lines)
Lines 133-139 Link Here
133
                            [% IF ( SMSSendDriver ) %]
133
                            [% IF ( SMSSendDriver ) %]
134
                                <ol><li><label>Notice:</label>Some charges for text messages may be incurred when using this service. Please check with your mobile service provider if you have questions.</li></ol>
134
                                <ol><li><label>Notice:</label>Some charges for text messages may be incurred when using this service. Please check with your mobile service provider if you have questions.</li></ol>
135
                                <ol><li>
135
                                <ol><li>
136
                                    <label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
136
                                    <label for="SMSnumber">SMS number:</label> <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" pattern="^\+?[1-9]\d{1,14}$" />
137
                                    <i>Please enter numbers only. <b>(123) 456-7890</b> would be entered as <b>1234567890</b>.</i>
137
                                    <i>Please enter numbers only. <b>(123) 456-7890</b> would be entered as <b>1234567890</b>.</i>
138
                                </li></ol>
138
                                </li></ol>
139
                            [% END %]
139
                            [% END %]
140
- 

Return to bug 22594