How to make a checkbox in a linked report turn other parameters optional (dynamic required params)

(6 posts) (2 voices)
  1. rpark, Member

    Hi,
    I have the basic logic situation where the user has to fill out a yes/no question to proceed to the next question. If the answer is 'yes', pamaraterA should be required, if the answer is 'no' paramaterB should be required.

    I know I can edit fields to be optional in the linked report's report parameters page, however, that is static and what I need is dynamic requirements based on user selections.

    I have looked through the documentation but can't seem to find the right place to start on this, if you could push me towards the answer I'd greatly appreciate that!

    Thank you!

  2. myDBR Team, Key Master

    So you have a linked report with three parameters: 1) yes/no 2) parameterA and 3) parameterB and based on yes/no the parameterA or parameterB needs to be chosen? Is this correct?

    If this would be the case, you would need JavaScript to hide/show the parameterA / parameterB based on the yes/no. You can fill the hidden one with some magic value.
    --
    myDBR Team

  3. rpark, Member

    Hi, the question isn't as much about visibility as it is mandatory fields.

    All 3 params can be on the same form visible, that's fine, however, I need the validation to change required elements dynamically based on the yes/no selection. Hiding elements and showing them will not stop the form from being submitted I do not think?

    So, if yes is selected, parameterA would be visible and required, parameter B can still be visible. However, you should not be able to submit the form if you only complete parameterB. The opposite is true if no is selected, parameterA could be completed, but parameterB is required and the form shouldn't submit without it.

    Hope that clears it up?

    Thanks!

  4. myDBR Team, Key Master

    You can keep both A and B values to be mandatory. When user chooses the parameterA to be selected, you can fill the parameterB value with some dummy value so it can be ignored when user submits the form. You can also hide the value that is no longer needed based on user's yes/no selection.

    --
    myDBR Team

  5. rpark, Member

    Hi,
    Thanks for the clarification, however, that would mean putting a dummy value into my database which is sub-optimal, I suppose that I could make the field accept NULLs and then use NULL.

    Or are you saying that there is a way to ignore the dummy value and bypass putting nonsense into the database?

    Thanks!

  6. myDBR Team, Key Master

    The parameters are just parameters. What you store in the database is fully up to you.

    --
    myDBR Team


Reply

You must log in to post.