Bind the dropdown to a secondary data source and then set the values using your script. Should be samples everywhere on this site (probably Greg has some in his blog), but that's the general technique. People with InfoPath 2007 can use qRules to do it without code.