web to lead form mandatory fields

web to lead form mandatory fields

How can i make the form fields in a web to CRM form mandatory?
I've tried a code suggested in the knowledge base but it doesn't work at all.

Is it possible to do?
It would be a great idea to make it an option to select which fields are mandatory when generating the code with the code generator in web to leads or web to contact forms.