Digital sign HTML form data before sending it to server?
Is it the good approach?


No, it is not. You say you want to do this for legal reasons. If your server knows the private key (as it does in this case), the server or anyone with access to the server will also have access to the private key and can therefore sign any form they want. Therefore, your proposal does not meet your goals.