Skip to content
🚀 Rapid Application Development with the App Builder

unsetValidationError(columnName)

Removes the error state of a specific column.

Scope: FORM

Parameters

ParameterTypeDescription
columnNamestringThe name of the database table column.

Return Value

None

✨ Example of a preFormSubmit Hook

Prevent update customer with ID 103.

js
((mode, getColumnValue, setValidationError, unsetValidationError) => {

	const error = "Customer 103 cannot be updated!"
	const customerNumber = getColumnValue("customerNumber")

	if (customerNumber == 103) {
		// Set validation error
		setValidationError("customerNumber", error)
	} else {
		// Don't forget to reset!
		unsetValidationError("customerNumber")
	}

})

Output

WP Data Access - Prevent Update with Custom Validation Error