Parameters

Not controlled by goerp, can be used to mirror some data after submitting the form. Basically, goerp will return all assigned parameters data with the response.

Let’s say we want to pass some data to the next page, using regular query parameter:

<a href="/{{ $.Session.ClientCode }}/{{ $.Session.Language.Code }}/example-page?my-custom-param=hello_there"></a>

And on the referenced page we can call this parameter using .Data.Parameters

<h1>Say Hi!</h1>
<p>{{ .Data.Parameters.my-custom-param }}</p>

Subsections of Parameters

Validation

It’s possible to instruct the server to validate incoming parameters to certain rules.

Register the rules on page “Form validation” configuration section.

Form validation Form validation

Enable and disable feature

You can use the toggle button to disable or enable the entered rules.

Rules

The parameter name is the full parameter name to be validated.

Type can be any of the following:

  1. required - checks that the parameter exists
  2. type - currently can have the value of a number, checks if the parameter is a valid number
  3. min - checks that the numeric value is higher or equal to the given value
  4. max - checks that the numeric value is lower or equal to the given value
  5. minLength - checks that the string value is at-least the given characters long
  6. maxLength - checks that the string value does not exceed the given amount of characters
  7. pattern - checks if the input is valid to the regex pattern (ex: .{8,})

Validation

The validation is completed for each rule and the errors are returned in the regular .Data.Errors array.

{{ range .Data.Errors }}
    {{ . }}
{{ end }}