Moved code from template to a separate javascript file viz settings-tariff.js