Mahler's theorem says that, for every prime p, the binomial polynomials form an orthonormal basis of the Banach space C(Zp,Qp) of continuous functions from Zp to Qp. Recently, replacing Qp by a local field K and Zp by the valuation ring V of K, Klinger and Marshall constructed generalized binomial polynomials such that these odd (resp. even) binomial polynomials form an orthonormal basis of the space of odd (resp. even) continuous functions from V to K. In this paper, we prove a similar result for odd and even functions in a more general framework by considering the Banach space C(E,K) of continuous functions, where K is any valued field and E is any symmetric regular compact subset of K.