HI all.

        I have this cross platform issue and when it comes to
validator-rules.xml I had a problem which I wanted to share with you.

        In the validator-rules.xml the parsing popup alert message has a bug
in netscpae.

        The line alert(fields.join('\n')); is fine for explorer but not in
netscape. The Join function does not do the work.

        Instead I used it like this:

        alert(join(fields,'\n'));


                function join(arr,token)
                {
                        /**
                         *  Description:
                         *              This function behaves like 'Join'
(Array function, which doesn't work in Netscape).
                         *              The join method is used for join all
the elements of an array into a single string 
                         *              separated by a specified string
separator (if none is specified, the default is a comma). 
                         *
                         *  parameters:
                         *               arr: given Array object.
                         *               token: string.
                         *
                         *  return: new parsed String.
                        */

                        retStr = "";

                        if (arr)
                        {
                                if(arr.length > 0)
                                {
                                        if (token != null) retStr =
replace(arr.toString(),",",token);
                                        else retStr = arr.toString();
                                }
                        }

                        return retStr;
                }


                I thought it would be interesting to you all.

                Ciao.

Reply via email to