What is the best way to prevent a standard ASP.NET form from submitting certain fields in the onsubmit event? Specifically, I have a registration page where I first validate the fields (RequiredFieldValidator) and then submit the form. However I would like to only submit the password hash from a hidden field, without the actual plain text password field.
I could override the default onsubmit function to nullify the fields before submitting, but then I won’t be able to validate the password. What is the best way to handle the situation?
I am writing in C# on ASP.NET 3.5.
Thank you.
You could keep the plain text inputs outside of the
<form>or remove them with javascript right before submitting the form or just ignore those fields on the server when handling the post.As for hashing the password client-side, check out this answer…