Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

By allanrp1
I'm looking for a way to validate a form in javascript, and check if it's filled.
I saw there was a method in 2.8 "validateForm", but i don't see it in 3.2

How can i get that?
User avatar
By amosbatto
There is a "required" property for most types of fields and there is a "validate" property in text fields where you can enter regular expressions to validate the input. See: ... s#Required ... s#Validate

I don't know of anyway to validate all the fields at once with JavaScript, except call grid.saveForm() or grid.submitForm().
By allanrp1
So it's not possible...
What can i do? i want to execute a script after a web entry, is there some way to automatically pass to another task without a user review?
User avatar
By amosbatto
I looked through the source code in workflow/public_html/lib/pmdynaform/build/js/PMDynaform.js:5962 and found the form.isValid() function.
It will validate all the field in the Dynaform. You can call it like this:

It returns true if all fields are good and false if any are required fields which are blank or any fields that don't match their validate regular expressions. It also shows red error messages under the fields that aren't validated in the Dynaform.

For example:
Code: Select all
var formId = $("form").prop("id");
if (getFormById(formId)isValid == true) {
If you want to validate a particular field you can call:

It shows the red error message for an empty required field or a text field which doesn't match its validate regular expression. Otherwise is shows nothing in the Dynaform. The function returns the field's model object, which can be examined.

If you want to remove or add the red asterisk (*) next to fields to show that they are required, then use the following methods:

These methods can only be used on fields that are marked as "required" or have a defined "validate" property. Unless you have a good reason to hide the asterisk, it is recommended to use the enableValidation() and disableValidation() instead of these methods.

If you need a array of all the fields in a Dynaform, you can use:

For example:
Code: Select all
var aFields = getFormById( $("form").prop("id") ).items.asArray();
for (var i = 0; i < aFields.length; i++ ) {
User avatar
By amosbatto
allanrp1 wrote:So it's not possible...
What can i do? i want to execute a script after a web entry, is there some way to automatically pass to another task without a user review?
When the user clicks on a submit button, it should automatically do the validation and won't allow the user to submit without all the fields passing validation. If you don't want validation of the fields, then disable the fields that require validation with disableValidation() or create a separate form for web entry which doesn't have fields that require validation.

By the way, if you want to place your custom log[…]

process reset itself

Hj, I have the same problem. There's any problem[…]

HI, I am using processmaker-3.3.6-1 version and I […]

Link to new dynaform

I couldn’t refrain from commenting. Very wel[…]