public class CustomValidator extends BaseValidator implements com.aspose.ms.System.ICloneable
Performs user-defined validation on an input control.
[Java] Pdf pdf1 = new Pdf(); aspose.pdf.Section Section1 = pdf1.getSections().add(); FormField textBox = new FormField(); textBox.setFormFieldType ( FormFieldType.Text); textBox.setFieldName ( "AText"); textBox.setFormWidth ( 80); textBox.setFormHeight ( 20); CustomValidator validator = new CustomValidator(); // Check if string is in lower case validator.seValidationFunction ( "var field = this.getField('AText'); if (field.value != field.value.toLowerCase()) app.alert('string must be in lower case');"); textBox.getValidators().add(validator); Section1.getParagraphs().add(textBox); pdf1.save(...);
Constructor and Description |
---|
CustomValidator() |
Modifier and Type | Method and Description |
---|---|
Object |
deepClone()
Clones a new
CustomValidator object. |
String |
getValidationFunction()
Gets or sets script (written in PDF JavaScript) used for validation.
|
void |
setValidationFunction(String value) |
getErrorMessage, setErrorMessage
public String getValidationFunction()
Gets or sets script (written in PDF JavaScript) used for validation.
public void setValidationFunction(String value)
public Object deepClone()
Clones a new CustomValidator
object. This method clones only the format but not contents of the cell.
deepClone
in interface com.aspose.ms.System.ICloneable
deepClone
in class BaseValidator
CustomValidator
object.Copyright © 2014 Aspose. All Rights Reserved.