No, I'm really from Test..



  •  While browsing through the VIA site I came across this contact form and I hit CTRL+U, the first item is this function;

    function check_mail(email_address) {
    //==========Check Other Char==========
    var i = 0;
    while (i < email_address.length) {
    var ch = email_address.substring(i++, i);
    if (!(ch == "-" || ch == "_" || ch == "." || (ch >= "0" && ch <= "9") ||
    (ch >= "@" && ch <= "Z") || (ch >= "a" && ch <= "z"))) {
    return(false);
    }
    }
    //==========Check Mail Format==========
    pos = email_address.indexOf("@");
    var chname = email_address.substring(0, pos);
    var chhost = email_address.substring(pos + 1, email_address.length);
    if (chname.length == 0 ||
    chhost.length == (chhost.lastIndexOf(".") + 1) ||
    chhost.indexOf("@") != -1 || chhost.indexOf(".") <= 0) {
    return(false);
    } else {
    pos = chhost.indexOf(".");
    while (chhost.indexOf(".", pos+1) != -1) {
    if ((pos+1) == chhost.indexOf(".", pos+1)) {
    return(false);
    }
    pos = chhost.indexOf(".", pos+1);
    }
    }
    return(true);
    }

    They have another function which uses regex, but they don't use it...

    Later on there are these lovely functions:

    function openquestion()	{
    }

    function openfield() {
    }

    function startup() {
    }

    Oh, and there are also duplicate countries in the list 

    <OPTION value="12/Armenia">Armenia</OPTION>                                                                    
    <OPTION value="430/Armenia">Armenia</OPTION>
    <OPTION value="13/Aruba">Aruba</OPTION>
    <OPTION value="14/Australia">Australia</OPTION>
    <OPTION value="330/Australia">Australia</OPTION>
    <OPTION value="15/Austria">Austria</OPTION>
    <OPTION value="16/Azerbaijan">Azerbaijan</OPTION>
    <OPTION value="431/Azerbaijan">Azerbaijan</OPTION>

    As well as the 'test' country! 

    <OPTION value="450/test">test</OPTION>

Log in to reply