Setup a single condition using xdExtension, such as:
xdExtension:myConditionCode()
Then write your code:
function myConditionCode()
{
... check your conditions here...
if(condition failed)
return true;
return false;
}

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
i'm currently using optional section with conditional formatting for hiding
the section depending on certain conditions.
but can we achieve the similar result using code? (i'm using java script).
since the conditional formatting is only limited to 5 conditions when my
case needs more.
thanks :)