WebView.SearchText
------------------

Searches text in a WebViewer.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [2.3](newinversion23.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "WebView.SearchText"; WebViewerRef; Text { ; Backward; CaseSensitive; Wrap } ) 

**MBS**( **"WebView.SearchText";** /\* Searches text in a WebViewer. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function.e.g. "web" \*/   
**$Text**; /\* The text to search for.e.g. "Hello" \*/   
**$Backward**; /\* Optional; A boolean value to determinate direction. Pass 0 for forward and 1 for backward. Default is 0. (This option has problems on Windows currently.)e.g. 0 \*/   
**$CaseSensitive**; /\* Optional; Whether to search case sensitive. Pass 1 for case sensitive and 0 for case insensitive. Default is 0.e.g. 0 \*/   
**$Wrap**) /\* Optional; A boolean value to decide whether to wrap around. If text is not found, we start search on the top again.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. | "web" |  |
| Text | The text to search for. | "Hello" |  |
| Backward | A boolean value to determinate direction. Pass 0 for forward and 1 for backward. Default is 0. (This option has problems on Windows currently.) | 0 | Optional |
| CaseSensitive | Whether to search case sensitive. Pass 1 for case sensitive and 0 for case insensitive. Default is 0. | 0 | Optional |
| Wrap | A boolean value to decide whether to wrap around. If text is not found, we start search on the top again. | 0 | Optional |

### Result

Returns 1 if the text was found and 0 if not.

### Description

Searches text in a WebViewer.   
This is like the search field in Safari. Please note that this feature works fine in FileMaker 10, but has problems in FileMaker 11.  
  
Not supported for WebKit 2.x (FileMaker 16 Mac), but works in FileMaker 16, when using a Web Viewer created using [WebView.Create](WebViewCreate.md).  
### Examples

Searches for text in WebViewer:

 MBS ("WebView.SearchText"; "web"; "Hello")  
### See also

- [WebView.Create](WebViewCreate.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.SelectedText](WebViewSelectedText.md)

### Blog Entries

- [MBS Filemaker Plugin, version 2.3pr4](https://www.mbsplugins.de/archive/2011-02-18/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 4th November 2021

  
[WebView.Scrollbar.set](WebViewScrollbarset.md) - [WebView.SelectAll](WebViewSelectAll.md)

[HTML Version](WebViewSearchText.shtml)