Wikipedia defines a quadratic form over a field $K$ to be
a map $q: V \to K$ from a finite-dimensional vector space over $K$ to $K$ such that $q(av) = a^2q(v)$ for all $a \in K, v \in V$ and the function $q(u+v) - q(u) - q(v)$ is bilinear.
What's the motivation for requiring $V$ to be finite-dimensional? Why not consider "infinite-dimensional quadratic forms", for example, functionals $q$ of real-valued functions $f(x)$ such as
$$q[f(x)] := \int_a^b u(x) f(x)^2\, dx$$
for some fixed integration kernel $u(x)$ and bounds of integration $a$ and $b$? (A "non-diagonal infinite-dimensional quadratic form" like $$q[f] := \iint_D f(x)\, u(x, y)\, f(y)\, dx\, dy$$ over some fixed open $D \subset \mathbb{R}^2$ would also work.)