The global existence of a pointwise solution to the Hamilton-Jacobi equation for totally observed controlled diffusions in Hilbert spaces is proved by studymg the corresponding control problem. The optimality principle for the control problem leads to local results, whilst an a priori bound is achieved by introducing a secondary minimization problem.