If you are unable to create a new account, please email support@bspsoftware.com

 

How to disable the Finish button until a user selects multiple optional prompts?

Started by psrpsrpsr, 12 Jul 2018 03:14:32 PM

Previous topic - Next topic

psrpsrpsr

I have been reading forums all day with no viable solution, so here goes:

I have a very simple customer search report using a table with millions of rows. I don't want the user to be able to submit the report until EITHER the Last Name or First Name text box prompt are filled in. Pretty simple stuff. Obviously, I don't want the user to be able to click 'Finish' and return millions of rows.

Users will need to search with varying degrees of completeness for a customer - they could have a first name, or a first, last, and DOB. Hence, the Required Field property is NOT a viable a solution, because I need the flexibility of an 'OR' condition between the First and Last Name prompts.

This seems like a very simple business scenario for which there is a huge number of posts with opaque solutions utilizing 2 prompt pages, javascript, conditional blocks/render variables, etc.

If someone could please give a detailed, step by step approach to solving this, and the best practices in general for this use case, it would be much appreciated.

Thank you!


sdf


psrpsrpsr

That is not a viable option. Users will have varying degrees of customer information that they will search for - this could be a first name and birth month, for example.

So the functionality I need is:
1.) IF the user HAS NOT entered ANY string into EITHER the Last Name or First Name prompts, THEN they CANNOT click 'Finish' to submit the report (because this will return millions of unfiltered rows.)
2.) IF the user HAS entered ANY string into EITHER Last/First name, THEN they can click finish to submit.

This blog post does a great job explaining the problem and presenting a JavaScript solution, however the solution is not working for me. http://cogblogger.com/2015/08/multi-prompt-validation/

CognosPaul

There are a couple of ways of doing this.

The first one is to write a custom finish button that checks the state of the two prompts. You can have it pop up (or popover) a notification that the user needs to select one of the prompts.

The other way, slightly harder, is two use the setValidator function on both the prompts, and then trigger the validator on both prompts whenever one is changed.