Setting default values inline
The widget is designed to be flexible. If you need a default value in a particular calculator form field, you can set this inline via JSON in the widget script tag itself. The widget will accept a property
called data-defaults. You can specify any model property by passing in a well-formed JSON string. Clients can log into Symmetry's Client Support Center for the full list of default properties.
Basic Example - Setting one property
Indiana as default state
<script async src="https://calculators.symmetry.com/widget/js/salary.js?key=yourKey"
data-defaults='{"model":{"state":"IN"}}'></script>
Example - Multiple properties
Indiana as default state, married as default federal filing status
<script async src="https://calculators.symmetry.com/widget/js/salary.js?key=yourKey"
data-defaults='{"model":{"state":"IN","federalFilingStatusType":"MARRIED"}}'></script>
The widget will accept any number of valid model properties. Clients should reference the default properties in Symmetry's Client Support Center documentation to see the names and acceptable values.
Updated over 1 year ago