In Dreamweaver create a record set for the group table and add a filter which compares the group number to the value entered in the form.
And if you wanted to add some text to show when the group number is invalid then Select the text and use the Dreamweaver Show Region server behavior by clicking the + button under the Server Behaviors panel (Window -> Server Behaviors) and select show region "Show if Record Set is Empty" and select the group record set. And then you will need to wrap the insert server behavior with the same condition, so it does not insert to the database if the group record set is empty.