How to Validate User Inputs Entered into an App
When developing a simulation app of a COMSOL Multiphysics model using the Application Builder, you can include input fields in your app that enable a user to enter a value and thus make changes to the simulation. Examples of this could be increasing the value of an external load or changing the dimensions of the geometry. When including such input fields it is important to provide the user with some guidance on if the values entered are valid. Here, we demonstrate doing this by adding various data validation bounds for parameters and including an error message to display when incompatible data is entered by a user.
Tutorial: Form Objects and Data Validation
Thesimplified thermal microactuator tutorial modelis used for the model example, which a simulation app was developed forpreviously. Here, the simulation app is extended by validating the data entered by a user for various input fields. Making changes to the app by using theForm Editoris shown. Topics covered in the tutorial video include the following:
- Overview of relevantForm Objects
- Text Label
- Input Field
- Unit
- Data Display
- Input Fieldform object settings
- Adding data validation bounds for parameters
- Entering an error message for data validation
Further Learning
- Simulation App Design Tips to Enhance User Workflow(blog post — see the Foster Control and Focus in App Users section)
请提交与此页面相关的反馈,或点击此处联系技术支持。