Disable Next button if Checkbox unchecked - ParameterGroup

Comments

1 comment

  • Avatar
    michiel

    It's not possible to disable the next button but you can use a <validationActionList> to prevent the user from continuing the installation.

    In the following example the <showquestion> action has a rule checking for the value of the checkbox. If the value is false the user will be asked if he wants to quit.. If the user answers no, we use <setinstallervariable> to set the next_page variable to be the same page to prevent the installer from continuing to the next page. If the user answers yes the installer will quit.

    <parameterGroup>
    <name>termsAndConditions</name>
      <parameterList>
        <linkParameter>
          <name>linkToTermsAndConditions</name>
          <description>http://example.com/TermsAndConditions</description>
          <clickedActionList>
            <launchBrowser>
              <url>http://example.com/TermsAndConditions</url>
            </launchBrowser>
          </clickedActionList>
        </linkParameter>
          <booleanParameter>
          <name>choice</name>
          <default>1</default>
          <displayStyle>checkbox-left</displayStyle>
          <description>Deselect this box if you do not agree with the Terms and Conditions</description>
        </booleanParameter>
      </parameterList>
      <validationActionList>
        <showQuestion>
          <text>Do you want to quit?</text>
          <variable>quit</variable>
          <ruleList>
            <compareValues logic="equals" value1="${choice}" value2="0">
            </compareValues>
          </ruleList>
        </showQuestion>
        <exit>
          <ruleList>
            <compareText logic="equals" value="${quit}" text="yes">
            </compareText>
          </ruleList>
        </exit>
        <setInstallerVariable name="next_page" value="termsAndConditions">
          <ruleList>
            <compareText logic="equals" value="${quit}" text="no">
            </compareText>
          </ruleList>
        </setInstallerVariable>
      </validationActionList>
    </parameterGroup>
    

Please sign in to leave a comment.