How can I validate user input?

Author: BitRock Support       Date: October 30, 2007 09:33       Tags: User input and custom installer pages

You can validate user input adding a <validationActionList> to the parameter. For example, adding the following code to the 'installdir' parameter, will prevent the user from selecting a directory that contains a space.


<validationActionList>
   <throwError>
      <text>This directory path can not contain spaces</text>
      <ruleList>
         <compareText>
          <text>${installdir}</text>
          <logic>contains</logic>
          <value> </value>
         </compareText>
      </ruleList>
   </throwError>
</validationActionList>
This will create an installer environment variable called
protocol
that will contain the value of the text selected by the user. You can later refer to the content of the that variable using ${protocol}. In this example, if the user selects HTTP (unsecure), the variable protocol will contain the value http. Click here to download a sample project.xml file that integrates this functionality.

 

Comments

Link to article doesn't work

Author: Mark Wolff       Date: May 19, 2009 19:39

Near the top of this page, the "here" link is for a missing article.


 

Back You should login to comment

 

You are
currently not
logged in.

 Log in 

or

Sign up