commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Stephan.Kuens...@it.nrw.de>
Subject [validator] client-side password validation using regex
Date Tue, 27 Jul 2010 09:49:39 GMT
Hi all,

I was wondering if it's possible to validate a <html:password> field on client-side
by using a regular expression.
A look at validateMask.js told me that the only field types supported are 'hidden', 'text',
'textarea' and 'file'.

Code:

            if ((field.type == 'hidden' ||
                field.type == 'text' ||
                 field.type == 'textarea' ||
                                 field.type == 'file') &&
                 (field.value.length > 0)) {

                if (!jcv_matchPattern(field.value, oMasked[x][2]("mask"))) {
                    if (i == 0) {
                        focusField = field;
                    }
                    fields[i++] = oMasked[x][1];
                    isValid = false;
                }
            }


Is this the exspected behavior? Is there any reason for not supporting 'password' fields?
If so, how would I validate a password field by using a regex (without changing the js file
on my own :))?

Cheers,
--
Stephan Künster
Information und Technik Nordrhein-Westfalen (IT.NRW)
Postanschrift: Postfach 10 11 05 * 40002 Düsseldorf
Dienstgebäude: Heesenstraße 26  * 40549 Düsseldorf
http://www.it.nrw.de<http://www.it.nrw.de/>

Ref. 324 * Geoinformationszentrum
Tel. 0211 9449-6310 * Fax: 0211 9449-6610
Email: stephan.kuenster@it.nrw.de<mailto:stephan.kuenster@it.nrw.de>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message