man...
i don't even know where to put it..
the code i have was writen by soime one else, just not sure where to mess wiuth it & 
dont want to jeepo bugging him.



function init(){
        oForm = new qForm("frmExample");
        
        oForm.apple.validateAtLeastOne("apple,orange,grape,banana,watermelon");
}

// [start] validation routine
function _f_isAtLeastOne(_f){
        var sFields = this.name + ((typeof _f == "string") ? "," + _removeSpaces(_f) : 
"");
        var aFields = sFields.split(","), v = new Array(), d = new Array(), x = ",";
        
        for( var i=0; i < aFields.length; i++ ){
                if( !this.qForm[aFields[i]] ) return alert("The field name \"" + 
aFields[i] + "\" does not exist.");
                // store the value in an array
                v[v.length] = this.qForm[aFields[i]].getValue();
                // if the field name is already in the list, don't add it
                if( x.indexOf("," + aFields[i] + ",") == -1 ){
                        d[d.length] = this.qForm[aFields[i]].description;
                        x += aFields[i] + ",";
                }
        }
        
        // if all of the form fields has empty lengths, then throw
        // an error message to the page
        if( v.join("").length == 0 ){
                this.error = "At least Three of the following fields is required:\n   
" + d.join(", ");
                for( i=0; i < aFields.length; i++ ){
                        if( qFormAPI.useErrorColorCoding && 
this.qForm[aFields[i]].obj.style ) this.qForm[aFields[i]].obj.style.backgroundColor = 
qFormAPI.errorColor;
                }
        }
}
_addValidator("isAtLeastOne", _f_isAtLeastOne, true);
// [ end ] validation routine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
                                

Reply via email to