Validate Disabled Fields

  • 29 June 2017
  • 6 replies
  • 13 views

Badge +3

How do I set validation rules to run on disabled controls? I have a workflow with a start form. The form has 3 fields. 2 of which are disabled, but must already be specific values in order to kick off the workflow. So I set validation rules on these controls, but the validation doesn't seem to kick off unless the field is enabled. The users can't change these fields so.... help? 

Thanks, Berney


6 replies

Badge +3

OK So I had the bright idea of associating the validation rules with the one enabled control and now the form submit is stopping. Yea. But the red box is appearing around the enabled control which may be correct. Boo. Is there a way to get rid of the red box? Or some other better way to do this?

Badge +3

OK I cheated a bit. I hid an enabled text box behind the disabled one and made it one block bigger. It doesn't look perfect, but not that bad. Then I associated the validation rule with that textbox which is linked to nothing, but it is enabled. Now I at least get a partial red box around the correct item. Maybe that is the answer, let me know if you can think of a better way to do this.

Thanks,

  Berney

Userlevel 5
Badge +13

So, what's the intent of this? Because if your user can't change the values, then why refuse them from being able to submit? Why not have the workflow start conditionally or something? Let the user submit the form but you can have a little message or something about "workflows won't trigger due to invalid values in fields A and B. Contact Jim Jimmerson to fix these values" or some such.

I also believe you could disable the save button in that case, kind of going around the validation rules but still using them in a way.....hmm......

In any case, I'm interested to know more info on your use case

Badge +3

This list is a request list where a request is submitted, it has to be processed and worked for up to 3 days. During that time the requester can create a revision of the current request. When that happens a copy of the current request is made, the new copy is given an incremented revision number and processing should stop on the initial request. When a revision is requested, a revision reason must be selected. 

I have added the ability for the user to start the workflow from the short cut menu. On the start form I am performing the checks to see if 2 conditions are met. Are they requesting the revision on an active request and has the team started working on the request. Originally I wrote the start form to show the value of the field in question and had a message next to it saying why that data restricted the user from submitting the form and the save button was disabled. The users said this was too subtle and they didn't understand why the save button was disabled. I also tried having the form set to always allow submit and then within the workflow I did the checks and sent an email to the requester if something was wrong. This was too disconnected for the team. I guess I could have written some JavaScript and had the form popup a message explaining why they couldn't submit the form, but validation rules seemed like the right place to go since I was already doing a validation on the revision reason field. 

Does that make sense?

Userlevel 5
Badge +14

place control into a panel and make panel disabled.

control will inherit disable status from panel, but still will be validated

Badge

This worked! Nothing too complex either. Controls on Panel, the Panel is disabled and control I want to validate against is enabled with validation rule. It can not be edited as is needed for my requirement.

Reply