User Manual - Modules Required Fields
From DotProjectWiki
Contents |
1 Overview
In all versions of dotProject released after 20061130, there's the possibility for some modules to specify fields for the addedit screen required to be filled in correctly by the user. As of 20061130 only the module projects has that feature.
2 Configuration
The Required Fields are a System Value (System Admin > System Lookup Values). For Projects the corresponding Value is called ProjectRequiredFields and so on.
The setting of these field limitations is - for flexibility reasons - more or less technical. If you're comfortable with JavaScript, then it's a no-brainer. If not, try to follow and change the examples below.
The synopsis is:
f.html_field_name.property|{logic which is used for checking against _WHETHER_ a warning to the user must be sent}
3 Examples
For instance, if you want to check if the Field 'Target Budget' is populated by the user you could add the following line to the 'ProjectRequiredField' system value:
f.project_target_budget.value|<1
Or if you want that field to be at least 3-digit styled:
f.project_target_budget.value.length|<3
You can sniff the html_field_name from your browser:
Open the corresponding addedit screen for which you want to set required fields. In Firefox, right-click on the site background and choose Show Source or similar. Then search in the window with the page source for the field description (e.g. 'Budget') and sniff the name=... value from the appropriate <input> tag after it
4 Warning Text
The user will receive a warning which is named in the following style
required_field_f.project_target_budget.value
which can be easily translated via the Translation Manager.
Back to:
User Manual
