validateAnyThree(objForm) {
var all_fields = new array('field1','field2','field3','field4','field5');
var null_field_counter = 0;
for(i = 0; i < all_fields.length; i++) {
//probably want to do a js trim before testing value...
if( objForm[all_fields[i]].value != '')
null_field_counter++;
}
if (null_field_counter > 2)
return false;
return true;
}
onsubmit="return validateAnyThree(this)"
Probably a bug in there somewhere... :)
--
jon
mailto:[EMAIL PROTECTED]
Tuesday, August 12, 2003, 10:55:55 AM, you wrote:
IPEC8AE> was looking at some js to require atleast 3 of 5 form fields to be entered.
IPEC8AE> am running into problems.
IPEC8AE> any one done some thing like this?
IPEC8AE> i have an example of requiring ANY 1 field
IPEC8AE> but cant make it work for ANY 3 out of 5..
IPEC8AE>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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