Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
hewstone

Veteran
Registered:
Posts: 118
Reply with quote  #1 

Quick question, is there a way to submit a form without validating required fields?

 

i.e.

 

·         I have a process with two actions which chain together.

·         On the second action I have a form with two ‘submit’ buttons (e.g. ‘<< Back’, ‘Next >>’).

·         These buttons determine what action to chain too next.

·         However, when I click either button, required fields get validated and the user will have to compete all fields before moving back or next.

 

Is there a way to ‘disable’ this validation on a submit button?

 

I understand that I can make all required fields optional and implement JavaScript validation, however the form itself has a lot of required fields and to do this would take a long time.

 

Is there a better, quicker way, of doing this?

0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #2 
The only way I can think of, and we implemented in one application with similar requirements, is to make the fields not required -- at least by making them optional on the Form properties of the action (you can leave them required on the form itself if desired).

If you then want validation, you'd do that in your "next" action.

We do something along these lines for our primary application.  Users can enter and save as draft (via the second form/action) as many times as they like.  If the required fields are filled in, the second action also displays a submit option, otherwise a return to edit form which highlights the required fields (but the fields are still not required).  In both cases the save as draft option is available.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #3 
We do this in our Wizard library that pretty much does what you are after anyway. What you need to do is have all fields' visibility dependent on a hidden checkbox field, set to true by default. If the 'back' button is clicked (or 'save' as well in our library), the field is set to false, thus hiding all fields just before submit and preventing validation.

The advantage of this approach is that it is easy, and the standard validation is both simple and 'visible' (red asterisk) to the users.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #4 
Interesting approach Jerome.  I may have to keep it in mind.  Though a couple of our forms have too many fields already (thankfully some should be able to be eliminated in V9) but doubling for checkboxes wouldn't be great for them.  However, for more normal sized forms (and one case I can think of in particular right now) this may be a very plausible approach.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
No need to double the fields - just make the dependency of all fields depend on this one checkbox field. When the field is set by a client script on submit, all the fields disappear (so no require fields are visible). The user does not need to see or know about this, and the checkbox is set to true on form load so the fields reappear at a stage or for the next action.

In version 9 I tried to do this by using panels, but hiding panels does not prevent required fields within the panels being trapped by validation. This is by design, although I have my issues with that design as it stands.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #6 
That makes a lot more sense.  Thanks for straightening me out on that.
Yea, I had hoped for the panel option as well, but even though the fields are visible they are still required.  A pain.  Which surprises me a little that the checkbox approach works if the panel approach doesn't, but it does so its all good.
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #7 
This worked ! Thanks a lot Jerome...
0
ducba

New Member
Registered:
Posts: 2
Reply with quote  #8 
Quote:
Originally Posted by Jerome
No need to double the fields - just make the dependency of all fields depend on this one checkbox field. When the field is set by a client script on submit, all the fields disappear (so no require fields are visible). The user does not need to see or know about this, and the checkbox is set to true on form load so the fields reappear at a stage or for the next action.

In version 9 I tried to do this by using panels, but hiding panels does not prevent required fields within the panels being trapped by validation. This is by design, although I have my issues with that design as it stands.


Thank you for this solution but how can i set the checkbox field value to "false" using client script (did you mean javascript?). I'm using version 9 and have a similar issue. I tried to set the hidden checkbox value using visual script (server-side script) at "OnFormSave" event and it didn't work.
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #9 
@ducba

Yes you have to set the checkbox using client script.

Server script executes AFTER the form validations are done, so those fail.

PS - setting the checkbox using javascript (document.getElementById) doesnt work either. The only thing that works is SetField()
0
praxkan

Veteran
Registered:
Posts: 142
Reply with quote  #10 
SetField("checkboxFieldName","","false");
0
ducba

New Member
Registered:
Posts: 2
Reply with quote  #11 
@praxkan Thanks a lot.

And i found out that we just need to set the required field's visibility = hidden using javascript at form's submit event and it is done. So a checkbox is not even needed.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!