Build custom questions from Free fields
Drecha Forms does not use a separate Pro-only custom-field editor. A custom question is created by choosing a Free field type and configuring its label, unique field key, choices, validation, layout, accessibility, and logic.
Use Number for values that will participate in a calculation. Keep field keys short and meaningful, such as quantity, unit_price, and estimated_total. A key must be unique and cannot begin with _drecha_.
Add a calculated display field
Calculated display is a read-only output included in Free. It recalculates in the browser for immediate feedback and is recalculated on the server before storage.
- Add the numeric source fields.
- Select each source field and note its Field key.
- Add Calculated display from the Advanced group.
- Enter an Expression using the source keys.
- Set Decimal places from 0 through 6.
- Save and submit several test values.
For example, this expression calculates a two-decimal estimate:
round(quantity * unit_price, 2)
Calculated display settings showing an expression based on quantity and unit price keys
Screenshot will be added here.
Supported operators are +, -, *, /, and %, with parentheses and unary plus or minus. Supported functions are min, max, round, floor, ceil, and abs. Non-numeric source data is treated as zero.
The expression engine does not use eval and does not execute JavaScript, PHP, function names outside the allowlist, or property access.
Avoid dependency and expression errors
Drecha Forms rejects a calculation when it:
- Refers to a field key that does not exist.
- Contains an unsupported token or function.
- Divides by zero during validation.
- Is empty, longer than 500 characters, or excessively complex.
- Creates a direct or indirect circle with another calculation or conditional rule.
Builder save error explaining an invalid or circular calculation dependency
Screenshot will be added here.
When one calculated field uses another, place the dependency in one direction. For example, subtotal may use quantity, and total may use subtotal; subtotal must not also use total.
Prefill a field from the page URL
URL prefilling is useful for campaign codes, plan names, event references, or a known email address. Treat every URL value as visitor-controlled data.
- Select an input field.
- Expand Layout & accessibility.
- Enter a URL prefill parameter, such as plan.
- Save and publish the form.
- Open its page with a query string such as ?plan=professional.
- Confirm the field value and submit a test.
Field settings showing plan as the URL prefill parameter
Screenshot will be added here.
The parameter name is sanitized when the form saves, and the incoming value is sanitized when rendered. Normal field and server validation still apply at submission. Password fields never accept URL prefilling.
Validate related fields at form level
Form-level validation compares two submitted fields. It supports Must match and Must not match.
Example: add Email and Confirm email fields, then require them to match.
- Open Form settings > Form-level validation.
- Select Add validation rule.
- Choose Email as First field.
- Choose Must match.
- Choose Confirm email as Second field.
- Enter an error such as “Enter the same email address in both fields.”
- Save and test matching and different values.
Form-level validation rule requiring two email fields to match
Screenshot will be added here.
Use Must not match when two fields must contain different values. The server performs the comparison after individual field validation and attaches the error to the first field.
Combine field-specific validation carefully
- Text-like fields support minimum and maximum length, alphanumeric, and no-whitespace rules.
- Number, rating, and range fields support minimum, maximum, and step settings.
- Choice values must match a configured stored value; sending an invented option is rejected.
- Email, URL, date, time, and date-time values receive strict server checks.
- Required Name and Address fields check their required subfields.
- Custom error messages replace generic field errors, so write them as a correction the visitor can perform.
Free and Pro differences
Calculated display fields, the safe expression engine, URL prefilling, field-specific validation, custom errors, and form-level match/not-match rules are all Free.
Advanced scoring, arbitrary formulas, remote code execution, and a separate Pro advanced-validation engine are not currently shipped. Do not design a workflow that depends on those roadmap items.
Troubleshoot advanced validation
A calculation displays zero
Confirm that every expression variable exactly matches a field key and that the source values are numeric. Empty and non-numeric values are intentionally evaluated as zero.
The browser result differs from the stored result
The server is authoritative and recalculates the value from validated inputs. Check for browser-edited values, invalid numeric input, or a stale cached form schema.
Prefilling does not work
Match the query parameter's spelling to URL prefill parameter, publish the latest form revision, and clear the page cache. Prefilling is intentionally disabled for Password fields.
Matching fields still fail
Both values must pass their own validation and be identical. Leading and trailing whitespace is removed from ordinary text input; choice and compound fields should only be compared when their stored shapes are compatible.
Help us improve
Was this article helpful?
Share a quick, anonymous rating.
Continue learning