# ConditionalInstructionCollection.IsValueValid Method

> Returns a value indicating whether the value of a specific form field is marked as valid. The corresponding validation is executed by the conditions of a conditional instruction and applied by an Instruction object, that marks the related form field as valid or invalid.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Not found:** no package of this release declares this member on this type or on a class it derives from
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > ConditionalInstructionCollection.IsValueValid Method
- **734 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/isvaluevalid-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/isvaluevalid-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/isvaluevalid-method/llms-full.txt

---

### Description

Returns a value indicating whether the value of a specific [form field](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/formfield/llms-full.txt) is marked as valid. The corresponding validation is executed by the [conditions](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/conditions-property/llms-full.txt) of a [conditional instruction](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/llms-full.txt) and applied by an [Instruction](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/instruction/llms-full.txt) object, that [marks](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/instruction/instructiontypes-enumeration/llms-full.txt) the [related form field](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/instruction/formfield-property/llms-full.txt) as valid or invalid.

### Syntax

No package of this release declares this member. The declaration below is the reference's, and code that uses it does not compile.

```csharp
public bool IsValueValid(FormField formField);
```

```vbnet
Public Function IsValueValid(ByVal formField As FormField) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| formField | Specifies the `FormField` that is checked. |

### Return Value

The return value is false, if a conditional instruction is applied that has marked the form field value as invalid. If such conditional instruction was not defined or a conditional instruction has marked the form field value as valid, the method returns true.

### Examples

In TX Text Control 34, `HasValidValue` is the current name of this validation operation. The following example highlights a form field when its conditional rules do not accept the current value.

```csharp
FormField formField = textControl.FormFields.GetItem();
if (formField != null &&
    !textControl.FormFields.ConditionalInstructions.HasValidValue(formField))
{
    formField.HighlightMode = HighlightMode.Always;
}
```

```vbnet
Dim formField As FormField = textControl.FormFields.GetItem()
If formField IsNot Nothing AndAlso
   Not textControl.FormFields.ConditionalInstructions.HasValidValue(formField) Then
    formField.HighlightMode = HighlightMode.Always
End If
```

---

## Nearby

- **Previous:** [ConditionalInstructionCollection.GetItems Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/getitems-method/llms-full.txt)
- **Next:** [ConditionalInstructionCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/remove-method/llms-full.txt)
