Re: .length is always 1



On Jul 31, 3:15 pm, maxwe...@xxxxxxxxx wrote:
For the record - the working JavaScript validator for WikiName format:

function checkup(theform){
        var form = document.forms[theform];
        var okay = true;
        if (form.name.value.match(/[A-Z][a-z0-9]*[0-9A-Z]/)) {
            wikiName = form.name.value.match(/[A-Z][a-z0-9]*[0-9A-
Z]/).toString();
                if (wikiName.length<3) {
                        alert(form.name.value + ' is not a WikiName - please use one word
with at least two capital letters');
                        okay = false;
                }
        }



You could as well use (array)[0], as GArlington pointed out, instead
of (array).toString().

That's probably more correct :

wikiName = form.name.value.match(/[A-Z][a-z0-9]*[0-9A-Z]/)[0];

--Jorge.
.