HTML layouts, components, etc.
- Check our UI components page for samples
Goerp server returns errors with every response. Errors are available in .Data.Errors variable which is array of strings. So it is possible to go through this array and display errors on page.
Adding small block into the page (or into layout) may look like that:
In addition to errors, response contains success flag which is available only after posting form with POST action and may be found in .Data.FormControl.PostActionSuccessful. So, right after errors block may be reasonable to add success message as well.
NOTE When you add the errors and success flag, you are not writing any flags. Goerp editor will check errors and success flag by itself.
The validation script is already embedded inside the script bundle.js
In order for the field to be important, it is enough to write in the required in input
Ready patterns For email
This pattern checks that an email address starts with one or more alphanumeric characters, which can be followed by any number of dots, hyphens, plus signs, and percent signs. This is followed by the @ symbol followed by the domain name For zipcode
This pattern checks that the Zipcode meets the following criteria: Consists of 5 digits For phone
Ready patterns Types For string
For numbers
The value of the checkbox is set based on the checkbox state. If checked, then it is true, otherwise false. Please note that input should have form-input class.