Set field value based on lookup
Can someone provide an example script of setting the value of one field in a form based on the lookup value in another form. The lookup table contains both data. For example, a lookup value is set in field1 and I want that action to set the value in field2 on the form. Thanks for you help.