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 defined in the default properties (requires login to Symmetry's Client Support Center) by passing in a well-formed JSON string.

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. View the default properties documentation to see the names and acceptable values.


Jump to top