OnValidate Multiple Fields

Hy,
I’m trying to validate a form with two fields. Starting off from your example in the documentation, I expanded it for the seconds field. But It is just working for the first on the second one is always in a failed state.

New-UDExpansionPanelGroup -Children {
New-UDExpansionPanel -Title 'Add Members to Group' -Icon 'user' -Children {
    New-UDForm -Id 'grouptoadd' -Content {
        New-UDTextbox -Label 'Group' -id "Group" -Placeholder 'groupname, e.g. role.wks.'
        New-UDTextbox -Label 'Member' -id "Member" -Placeholder 'member to add'
    } -OnValidate {
    
        if ($EventData.Group -eq $null -or $EventData.Group -eq '' )
        {
            New-UDFormValidationResult -ValidationError "Group is required"
        }
        elseif ((Get-ADUser -Filter { Name -eq $EventData.Group }) -or (Get-ADComputer -Filter { Name -eq $EventData.Group }) -or (Get-ADGroup -Filter { Name -eq $EventData.Group }))
        {
            $GroupValid = $true
        }

        if ($EventData.Member -eq $null -or $EventData.Member -eq '' )
        {
            New-UDFormValidationResult -ValidationError "Member is required"
        }
        elseif ((Get-ADUser -Filter { Name -eq $EventData.Member }) )
        {
            $MemberValid = $true
        }

        if ($GroupValid -and $MemberValid)
        {
            New-UDFormValidationResult -Valid
        }
        .
        .
        .

Any idea what I’m doing wrong?
Thanks
Faba