Many thanks - that works fine now. Also:
This example only checks if the surname field matches the surname input field. Because some names are entered by users the other way round I wanted to check the forename field against the surname input as well. Is that possible?