Validation on a particular Button click


Badge +3

Hi All,

I have a requirement where I need one Text box field to not be empty when a particular button is clicked. I am trying to achieve this via Validation Rules. I am applying the validation on the button instead of the tex box because it should work only on that button click. However the Validation is not working. Can anyone please help me. Below is screenshot of the validation applied.

Validation for button


3 replies

Userlevel 5
Badge +14

I would highly recommend that instead of trying to set this up the way that you are, to instead us a Yes / No Control, which can be validated against (from the TextBox) very easily.

From a user perspective, it would also probably be easier being that accidental button clicks happen sometimes, and without a clear indication of that 'toggle', it's difficult to tell which state the form is in. 

The Yes / No Control takes care of that rather easily. 

Badge +3

Hi nmarples,

Thank you for your reply. I have tried a workkaround and disabled the button untill there is data in textbox. However if there is better way to apply validation on button click,it will be really great. Thanks for your support.

Regards,

Akshay

Userlevel 5
Badge +14

Use a Yes/No control as I mentioned earlier. 

Here is an example Yes/No control called "Toggle" 
215175_pastedImage_1.png

Here is a TextBox Control called "SomeTextBox":

215176_pastedImage_2.png

On the Form they look like: 

215177_pastedImage_3.png

Create a Validation Rule on the Text Box: 

215178_pastedImage_4.png

Here is the Rule's Formula: 

215179_pastedImage_5.png

Now if you try to Submit the form when that Checkbox is Toggled, and nothing is in the Text Box, it will not be valid: 

215180_pastedImage_6.png

If you fill it out though: 

215181_pastedImage_7.png

You could even take it a step further by adding a Formatting Rule to your Text Box control that disables it if the check box is not checked! 

Hope this helps. 

Reply