formFieldsArray(default: null)
Specifies custom form field configurations for AI processing. If not provided, the button will automatically detect form fields.
formFields.field String
The name of the form field that corresponds to a form element.
formFields.type String
The expected data type of the form field.
formFields.description String
A description of the form field that helps the AI service understand its purpose.
formFields.allowedValues Array
An array of allowed values that restricts the AI service to only use specific values for this field.
Example
<form id="form">
<input name="firstName" />
<input name="lastName" />
<input name="email" />
<select name="category">
<option value="">Select category</option>
<option value="business">Business</option>
<option value="personal">Personal</option>
<option value="urgent">Urgent</option>
</select>
<button id="smartPasteButton"></button>
</form>
<script>
$("#smartPasteButton").kendoSmartPasteButton({
formFields: [
{ field: "firstName", type: "string", description: "Person's first name" },
{ field: "lastName", type: "string", description: "Person's last name" },
{ field: "email", type: "email", description: "Email address" },
{ field: "category", type: "string", description: "Contact category", allowedValues: ["business", "personal", "urgent"] }
],
service: {
url: "https://your-ai-service.com/api/parse"
}
});
</script>