Previous Next
Tutorial: More State Input

Now that we've seen how to dynamically update the state_exemptions input field, we're ready to tackle the handling of two more input fields for those states which need additional information.

In order to accomodate the different requirements of various taxing jurisdictions, we include 'miscellaneous' and 'auxiliary' input fields. These are generic floating point parameters which are sometimes needed when a tax formula requires extra information.

For example, the Alabama Income Tax withholding formula allows the employee to optionally claim a 'Personal Exemption'. This is separate from the State Exemptions field used previously, which for Alabama represents the number of dependents other than the employee's spouse.

So for Alabama, the 'miscellaneous' field is used to indicate personal exemption preferences. However, we need to convey the intent for the input field to the user. Rather than just including a "Miscellaneous:" label, we'll adjust the terminology and title to reflect the usage. In the rarer case where two additional input values are needed, we use the 'auxiliary' field in the same way.

index.html:
Javascript:

Result:

Now when you select different states, you'll see additional fields changing.
















Output


Previous
Next