JS for advanced rule settings