You are here: Skip Navigation Linksxnodesystems.com > Products > XField Suite > CVV Code Field

CVV Code Field - ASP.NET Web control for credit card verification code (CVV) data entry and validation

CVV Code Field is an ASP.NET Web control rendered as a labeled text box that is used to enter, display and validate credit card verification code (CVV Code).

Implementation

CVV Code Field is implemented by the CVVCodeField class.

Documentation

Click here to see the documentation of the CVVCodeField class.

Validations

CVV Code Field supports validations in the following execution order.

  • Not null validation
  • Data format validation
  • Compare to value validation
  • Compare to control validation
  • Custom validation

Custom Validation

CVV Code Field supports custom validation at both client-side and server-side. To setup the custom validation error message, use the CVVCodeField.CustomValidation.Message property; to setup client-side custom validation, use the CVVCodeField.CustomValidation.ClientValidator property to specify the name of a JavaScript function that is used to perform client-side custom validation; to setup server-side custom validation, handle the server-side CustomValidate event.

The custom client validator function must take one parameter which in run-time will receve the validation context as a JSON object in the following format:

{"source":textBoxId, "data":inputText, "callback":callbackFunction}.

Here the "source" contains the id of the text box; "data" contains the text of the text box; "callback" contains a function that can be used during asynchronous custom validation to notify the XField's Client Validation Engine about the result of the validation.

To perform synchronous custom validation, add validation logic in the custom client validator you provide, and return a boolean value to indicate whether the field data passes the validation or not.

To perform asynchronous (Ajax) custom validation, first save the callback function somewhere (typically in a global variable); then setup Ajax call to the server-side to handle custom validation. After the Ajax call completes, notify the XField's Client Validation Engine about the result of the validation by invoking the saved callback with a boolean value to indicate whether the field data passes the validation or not.

View Custom Validation Demo of CVV Code Field.

Go to top