---
title: "webView(_:validate:defaultValidation:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webuidelegate/webview(_:validate:defaultvalidation:)"
---

# webView(_:validate:defaultValidation:)

Returns a Boolean value that indicates whether the specified user interface item is valid.

## Declaration

```swift
optional func webView(_ webView: WebView!, validate item: (any NSValidatedUserInterfaceItem)!, defaultValidation: Bool) -> Bool
```

## Parameters

- `webView`: The web view that sent the message.
- `item`: The user interface item being validated.
- `defaultValidation`: doc://com.apple.documentation/documentation/Swift/true if the web view believes the user interface item is valid; otherwise, doc://com.apple.documentation/documentation/Swift/false.

## Return Value

Return Value true if the specified user interface item is valid; otherwise, false.

## Discussion

Discussion See NSUserInterfaceValidations and NSValidatedUserInterfaceItem for more information about user interface validation. If you do not implement this method, the value of defaultValidation is used.

## See Also

### Controlling Other Behaviors

- [webView(_:shouldPerformAction:fromSender:)](webkit/webuidelegate/webview(_:shouldperformaction:fromsender:).md)
