Search...
wixFormFields
An array of objects representing the fields on a Wix Form.
Type:
Array<WixFormField>Read Only
NAME
TYPE
DESCRIPTION
id
string
The WixForms
element's unique identifier. Used when selecting elements using the $w()
selector.
fieldName
string
Name of the field.
fieldValue
string
Value of the field. If the field is a checkbox, its value is the checked property. If the field is a Captcha, its value is the token property. If the field is a file upload, its value is an array of the uploaded files' type.
Was this helpful?
An event triggered on a WixForms element when the Wix Form is submitted
Copy Code
1$w("#myWixForm").onWixFormSubmitted( {fields} => {2 let firstName = fields[0].fieldValue;3 let lastName = fields[1].fieldValue;4 let donation = fields[2].fieldValue;5 let email = fields[3].fieldValue;6 $w('#myText').text = `Thank you, ${firstName} ${lastName}, for your generous donation of ${donation}.`;7});89/* fields array of objects:10 * [11 * {12 * "id" : "inputFirstName",13 * "fieldValue" : "Maria",14 * "fieldName" : "Enter first name"15 * },16 * {17 * "id" : "inputLastName",18 * "fieldValue" : "Santora",19 * "fieldName" : "Enter last name"20 * },21 * {22 * "id" : "inputDonation",23 * "fieldValue" : "1000",24 * "fieldName" : "Enter donation amount"25 * },26 * {27 * "id" : "inputEmail",28 * "fieldValue" : "ms@theCompany",29 * "fieldName" : "Enter email"30 * }31 * ]32 */