Hi,
I have a situation where I need to save images along with name, phone number etc. fields to a collection using wix code. Name, phone number fields validations to be done using wix code before saving to the collection. How can I do this using wix code alone? Please post complete code.
Hi, greenmango318.
Hard to post the complete code when you didn’t specify the exact validations you want done on the Name and Phone # fields. IAC, one way to effect what you want would to be implement code in the dataset’s beforeInsert() method.
Here are a couple links for you:
- https://www.wix.com/code/reference/wix-data.Hooks.html#beforeInsert
- Velo: About Data Hooks | Help Center | Wix.com
From what I see there, if a validation fails, you can prevent the record from being inserted.
The validations I want are
For Name: only alphabets, no numbers.
For Phone: 10 digit numbers valid USA.
Hope this is OK to provide the actual
The validations I want are
For Name: only alphabets, no numbers.
For Phone: 10 digit numbers valid USA.
Hope this is OK to provide the actual