Set Hidden Field Value on Webform Connected to CiviCRM on Submit
I managed to get this to work by creating a custom text field in Civi. I then included this text field in the webform as a hidden component and set a default value. This value then gets set (for the text field) only when the form is submitted. I can then test the field to see if it has the set value or not and use this to hide or block the webform from the user.