Add inactive state check after a single field validation. Clean up JS syntax.