You can set up a custom calculate script for the second field that's something like:
// Get the value of the first field
var v = getField("Field 1").valueAsString;
// Add leading/trailing asterisks if not blank
event.value = v ? "*" + v + "*" : "";
Replace "Field 1" with the actual name of the field.
George, Thanks, that does the trick. At first, I had field 2 as a duplicate of field 1, and in this case, your script did not work. But after creating two separate form fields, with the script applied to field 2, then everything worked as expected.